From b9217ca238c1890c72265d2fa44a6df8fdaf6dbf Mon Sep 17 00:00:00 2001 From: Mario Campos Date: Fri, 2 Jul 2021 08:07:06 -0500 Subject: [PATCH] Test presence of database instead of results of analysis This is for PR #607, 'source-root' input test case. --- .github/workflows/pr-checks.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index dc78453d8..e60ba6cbc 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -905,21 +905,11 @@ jobs: with: languages: javascript source-root: tests/multi-language-repo - - uses: ./analyze - with: - output: "${{ runner.temp }}/results" - env: - TEST_MODE: true - - name: Assert Results + - name: Assert database exists run: | - cd "$RUNNER_TEMP/results" - # We should have 3 hits from these rules - EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block" - - # use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace - RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)" - echo "Found matching rules '$RULES'" - if [ "$RULES" != "$EXPECTED_RULES" ]; then - echo "Did not match expected rules '$EXPECTED_RULES'." + cd "$RUNNER_TEMP/codeql_databases" + if [[ ! -d javascript ]]; then + echo "Did not find a JavaScript database" exit 1 fi +