File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ cd "$TOOL_DIR"
3636# Convert absolute paths to relative paths in the output
3737# Handle both path formats: with and without extra codacy-cli-v2
3838sed -i ' s|file:///home/runner/work/codacy-cli-v2/|file:///|g' actual.sarif
39+ sed -i ' s|file:///Users/runner/work/codacy-cli-v2/|file:///|g' actual.sarif
3940
4041# Debug information
4142echo " Current directory: $( pwd) "
@@ -46,6 +47,12 @@ ls -la "$EXPECTED_SARIF" || echo "File not found or not accessible"
4647jq --sort-keys ' if .runs[0].tool.driver.rules == null then . else .runs[0].tool.driver.rules |= sort_by(.id) end' " $EXPECTED_SARIF " > expected.sorted.json
4748jq --sort-keys ' if .runs[0].tool.driver.rules == null then . else .runs[0].tool.driver.rules |= sort_by(.id) end' actual.sarif > actual.sorted.json
4849
50+ # Normalize paths in both files
51+ sed -i ' s|"/home/runner/work/codacy-cli-v2/|"/|g' expected.sorted.json
52+ sed -i ' s|"/Users/runner/work/codacy-cli-v2/|"/|g' expected.sorted.json
53+ sed -i ' s|"/home/runner/work/codacy-cli-v2/|"/|g' actual.sorted.json
54+ sed -i ' s|"/Users/runner/work/codacy-cli-v2/|"/|g' actual.sorted.json
55+
4956# Run diff and capture its exit code
5057if ! diff expected.sorted.json actual.sorted.json; then
5158 echo " ❌ Test output does not match expected output for $TOOL_NAME "
You can’t perform that action at this time.
0 commit comments