Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions test/cli/index/common/fail-self-referencing-metaschema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi

cat << EOF > "$TMP/expected.txt"
cat << EOF > "$TMP/expected1.txt"
Writing output to: $(realpath "$TMP")/output
Using configuration: $(realpath "$TMP")/one.json
Detecting: $(realpath "$TMP")/schemas/test.json (#1)
Expand All @@ -67,4 +67,21 @@ error: Could not resolve the metaschema of the schema
Did you forget to register a schema with such URI in the one?
EOF

diff "$TMP/output.txt" "$TMP/expected.txt"
cat << EOF > "$TMP/expected2.txt"
Writing output to: $(realpath "$TMP")/output
Using configuration: $(realpath "$TMP")/one.json
Detecting: $(realpath "$TMP")/schemas/my-metaschema.json (#1)
Detecting: $(realpath "$TMP")/schemas/test.json (#2)
( 50%) Resolving: my-metaschema.json
(100%) Resolving: test.json
( 2%) Producing: configuration.json
( 5%) Producing: version.json
( 8%) Producing: explorer/%/404.metapack
( 11%) Producing: schemas/example/schemas/my-metaschema/%/schema.metapack
error: Could not resolve the metaschema of the schema
https://sourcemeta.com/example/schemas/my-metaschema

Did you forget to register a schema with such URI in the one?
EOF

diff "$TMP/output.txt" "$TMP/expected1.txt" || diff "$TMP/output.txt" "$TMP/expected2.txt"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff ... || diff ... will still print the first diff’s output when the output matches expected2.txt, so this test can be “passing” but noisy in CI logs. Consider ensuring the first mismatch doesn’t emit diff output when the fallback succeeds.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Loading