-
Notifications
You must be signed in to change notification settings - Fork 42
Style human-readable install progress #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| MAKE DIRECTORY source | ||
|
|
||
| MAKE DIRECTORY project | ||
|
|
||
| WRITE source/schema.json UNTIL EOF | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "string" | ||
| } | ||
| EOF | ||
|
|
||
| WRITE project/jsonschema.json UNTIL EOF | ||
| { | ||
| "dependencies": { | ||
| "[CWD_URI]/source/schema.json": "./vendor/schema.json" | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| REPLACE '[CWD_URI]' WITH $CWD_URI IN project/jsonschema.json | ||
|
|
||
| RUN install STDIN /dev/null IN project INTO result_0.txt EXPECTING 0 | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_0.txt | ||
| REPLACE $CWD WITH '[CWD]' IN result_0.txt | ||
|
|
||
| WRITE expected_0.txt UNTIL EOF | ||
| 2> Fetching : [CWD_URI]/source/schema.json | ||
| 2> Installed : [CWD]/project/vendor/schema.json | ||
| EOF | ||
|
|
||
| COMPARE result_0.txt AGAINST expected_0.txt | ||
|
|
||
| WRITE project/vendor/schema.json UNTIL EOF | ||
| TAMPERED CONTENT | ||
| EOF | ||
|
|
||
| COPY project/jsonschema.lock.json TO lock_before.json | ||
|
|
||
| // Validation failure with forced color | ||
| RUN install --frozen --color always STDIN /dev/null IN project INTO result_1.txt EXPECTING 2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: These new frozen failure tests cover only human-readable output, leaving JSON failure events unverified. Add a matching (Based on your team's feedback about JSON variants for failure tests.) [8987a25a-4f41-4a67-914e-ada0d55918a7] Prompt for AI agents |
||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_1.txt | ||
| REPLACE $CWD WITH '[CWD]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[1;33m' WITH '[ANSI_BOLD_YELLOW]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[0m' WITH '[ANSI_RESET]' IN result_1.txt | ||
|
|
||
| WRITE expected_1.txt UNTIL EOF | ||
| 2> [ANSI_BOLD_YELLOW]Mismatched[ANSI_RESET] : [CWD]/project/vendor/schema.json | ||
| 2> error: File hash does not match lock file in frozen mode | ||
| 2> at uri [CWD_URI]/source/schema.json | ||
| EOF | ||
|
|
||
| COMPARE result_1.txt AGAINST expected_1.txt | ||
|
|
||
| COMPARE project/jsonschema.lock.json AGAINST lock_before.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| MAKE DIRECTORY source | ||
|
|
||
| MAKE DIRECTORY project | ||
|
|
||
| WRITE source/schema.json UNTIL EOF | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "string" | ||
| } | ||
| EOF | ||
|
|
||
| WRITE source/other.json UNTIL EOF | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "number" | ||
| } | ||
| EOF | ||
|
|
||
| WRITE project/jsonschema.json UNTIL EOF | ||
| { | ||
| "dependencies": { | ||
| "[CWD_URI]/source/schema.json": "./vendor/schema.json", | ||
| "[CWD_URI]/source/other.json": "./vendor/other.json" | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| REPLACE '[CWD_URI]' WITH $CWD_URI IN project/jsonschema.json | ||
|
|
||
| RUN install STDIN /dev/null IN project INTO result_0.txt EXPECTING 0 | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_0.txt | ||
| REPLACE $CWD WITH '[CWD]' IN result_0.txt | ||
|
|
||
| WRITE expected_0.txt UNTIL EOF | ||
| 2> Fetching : [CWD_URI]/source/other.json | ||
| 2> Installed : [CWD]/project/vendor/other.json | ||
| 2> Fetching : [CWD_URI]/source/schema.json | ||
| 2> Installed : [CWD]/project/vendor/schema.json | ||
| EOF | ||
|
|
||
| COMPARE result_0.txt AGAINST expected_0.txt | ||
|
|
||
| WRITE project/jsonschema.json UNTIL EOF | ||
| { | ||
| "dependencies": { | ||
| "[CWD_URI]/source/schema.json": "./vendor/schema.json" | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| REPLACE '[CWD_URI]' WITH $CWD_URI IN project/jsonschema.json | ||
|
|
||
| COPY project/jsonschema.lock.json TO lock_before.json | ||
|
|
||
| // Validation failure with forced color | ||
| RUN install --frozen --color always STDIN /dev/null IN project INTO result_1.txt EXPECTING 2 | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[1;32m' WITH '[ANSI_BOLD_GREEN]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[1;31m' WITH '[ANSI_BOLD_RED]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[0m' WITH '[ANSI_RESET]' IN result_1.txt | ||
|
|
||
| WRITE expected_1.txt UNTIL EOF | ||
| 2> [ANSI_BOLD_GREEN]Up to date[ANSI_RESET] : [CWD_URI]/source/schema.json | ||
| 2> [ANSI_BOLD_RED]Orphaned[ANSI_RESET] : [CWD_URI]/source/other.json | ||
| EOF | ||
|
|
||
| COMPARE result_1.txt AGAINST expected_1.txt | ||
|
|
||
| COMPARE project/jsonschema.lock.json AGAINST lock_before.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| MAKE DIRECTORY source | ||
|
|
||
| MAKE DIRECTORY project | ||
|
|
||
| WRITE source/schema.json UNTIL EOF | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "string" | ||
| } | ||
| EOF | ||
|
|
||
| WRITE project/jsonschema.json UNTIL EOF | ||
| { | ||
| "dependencies": { | ||
| "[CWD_URI]/source/schema.json": "./vendor/schema.json" | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| REPLACE '[CWD_URI]' WITH $CWD_URI IN project/jsonschema.json | ||
|
|
||
| RUN install STDIN /dev/null IN project INTO result_0.txt EXPECTING 0 | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_0.txt | ||
| REPLACE $CWD WITH '[CWD]' IN result_0.txt | ||
|
|
||
| WRITE expected_0.txt UNTIL EOF | ||
| 2> Fetching : [CWD_URI]/source/schema.json | ||
| 2> Installed : [CWD]/project/vendor/schema.json | ||
| EOF | ||
|
|
||
| COMPARE result_0.txt AGAINST expected_0.txt | ||
|
|
||
| WRITE project/jsonschema.json UNTIL EOF | ||
| { | ||
| "dependencies": { | ||
| "[CWD_URI]/source/schema.json": "./vendor/schema.json", | ||
| "file:///zzz/fake/new.json": "./vendor/new.json" | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| REPLACE '[CWD_URI]' WITH $CWD_URI IN project/jsonschema.json | ||
|
|
||
| COPY project/jsonschema.lock.json TO lock_before.json | ||
|
|
||
| // Validation failure with forced color | ||
| RUN install --frozen --color always STDIN /dev/null IN project INTO result_1.txt EXPECTING 2 | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[1;32m' WITH '[ANSI_BOLD_GREEN]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[1;31m' WITH '[ANSI_BOLD_RED]' IN result_1.txt | ||
| REPLACE MATCHING '\x1B\[0m' WITH '[ANSI_RESET]' IN result_1.txt | ||
|
|
||
| WRITE expected_1.txt UNTIL EOF | ||
| 2> [ANSI_BOLD_GREEN]Up to date[ANSI_RESET] : [CWD_URI]/source/schema.json | ||
| 2> [ANSI_BOLD_RED]Untracked[ANSI_RESET] : file:///zzz/fake/new.json | ||
| EOF | ||
|
|
||
| COMPARE result_1.txt AGAINST expected_1.txt | ||
|
|
||
| COMPARE project/jsonschema.lock.json AGAINST lock_before.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Frozen mismatches are failures, but this label remains yellow. Select
FAILURE_STYLEwhenorphaned_behavior == OrphanedBehavior::Errorand keepWARNING_STYLEfor automatically repaired mismatches.Prompt for AI agents