Skip to content

Commit 0422c3b

Browse files
mario-camposaofaof0907
authored andcommitted
Test presence of database instead of results of analysis
This is for PR github#607, 'source-root' input test case.
1 parent 17c2243 commit 0422c3b

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.github/workflows/pr-checks.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -905,21 +905,11 @@ jobs:
905905
with:
906906
languages: javascript
907907
source-root: tests/multi-language-repo
908-
- uses: ./analyze
909-
with:
910-
output: "${{ runner.temp }}/results"
911-
env:
912-
TEST_MODE: true
913-
- name: Assert Results
908+
- name: Assert database exists
914909
run: |
915-
cd "$RUNNER_TEMP/results"
916-
# We should have 3 hits from these rules
917-
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
918-
919-
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
920-
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
921-
echo "Found matching rules '$RULES'"
922-
if [ "$RULES" != "$EXPECTED_RULES" ]; then
923-
echo "Did not match expected rules '$EXPECTED_RULES'."
910+
cd "$RUNNER_TEMP/codeql_databases"
911+
if [[ ! -d javascript ]]; then
912+
echo "Did not find a JavaScript database"
924913
exit 1
925914
fi
915+

0 commit comments

Comments
 (0)