| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1cc5f1d commit f612b8c
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,6 +82,42 @@ jobs: | |||
| 82 | 82 | exit 1 | |
| 83 | 83 | fi | |
| 84 | 84 | ||
| 85 | + # Packaging test that runs against a javascript database | ||
| 86 | + test-packaging-javascript: | ||
| 87 | + needs: [check-js, check-node-modules] | ||
| 88 | + runs-on: ubuntu-latest | ||
| 89 | + | ||
| 90 | + steps: | ||
| 91 | + - uses: actions/checkout@v2 | ||
| 92 | + - name: Move codeql-action | ||
| 93 | + shell: bash | ||
| 94 | + run: | | ||
| 95 | + mkdir ../action | ||
| 96 | + mv * .github ../action/ | ||
| 97 | + mv ../action/tests/multi-language-repo/{*,.github} . | ||
| 98 | + mv ../action/.github/workflows .github | ||
| 99 | + - uses: ./../action/init | ||
| 100 | + with: | ||
| 101 | + db-location: "${{ runner.temp }}/customDbLocation" | ||
| 102 | + config-file: ".github/codeql/codeql-config-packaging.yml" | ||
| 103 | + languages: javascript | ||
| 104 | + # TODO: this is temporary until we have a release that includes the latest packaging work. | ||
| 105 | + tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210606/codeql-bundle-linux64.tar.gz | ||
| 106 | + | ||
| 107 | + - name: Build code | ||
| 108 | + shell: bash | ||
| 109 | + run: ./build.sh | ||
| 110 | + - uses: ./../action/analyze | ||
| 111 | + with: | ||
| 112 | + output: "${{ runner.temp }}/results" | ||
| 113 | + env: | ||
| 114 | + TEST_MODE: true | ||
| 115 | + - run: | | ||
| 116 | + cd "$RUNNER_TEMP/results" | ||
| 117 | + # TODO: run some assertions on the sarif | ||
| 118 | + ls | ||
| 119 | + cat * | ||
| 120 | + | ||
| 85 | 121 | # Identify the CodeQL tool versions to integration test against. | |
| 86 | 122 | check-codeql-versions: | |
| 87 | 123 | needs: [check-js, check-node-modules] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -799,7 +799,10 @@ function getCodeQLForCmd(cmd: string): CodeQL { | |||
| 799 | 799 | const parsedOutput: PackDownloadOutput = JSON.parse(output); | |
| 800 | 800 | if ( | |
| 801 | 801 | Array.isArray(parsedOutput.packs) && | |
| 802 | - parsedOutput.packs.every((p) => p.name && p.version) | ||
| 802 | + // TODO PackDownloadOutput will not include the version if it is not specified | ||
| 803 | + // in the input. The version is always the latest version available. | ||
| 804 | + // It should be added to the output, but this requires a CLI change | ||
| 805 | + parsedOutput.packs.every((p) => p.name /* && p.version */) | ||
| 803 | 806 | ) { | |
| 804 | 807 | return parsedOutput; | |
| 805 | 808 | } else { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ test("ensure lines of code works for cpp and js", async (t) => { | |||
| 20 | 20 | ||
| 21 | 21 | t.deepEqual(results, { | |
| 22 | 22 | cpp: 6, | |
| 23 | - javascript: 3, | ||
| 23 | + javascript: 9, | ||
| 24 | 24 | }); | |
| 25 | 25 | }); | |
| 26 | 26 | ||
@@ -34,7 +34,7 @@ test("ensure lines of code can handle undefined language", async (t) => { | |||
| 34 | 34 | ); | |
| 35 | 35 | ||
| 36 | 36 | t.deepEqual(results, { | |
| 37 | - javascript: 3, | ||
| 37 | + javascript: 9, | ||
| 38 | 38 | python: 5, | |
| 39 | 39 | }); | |
| 40 | 40 | }); | |
@@ -93,6 +93,6 @@ test("ensure lines of code can handle exclude", async (t) => { | |||
| 93 | 93 | ); | |
| 94 | 94 | ||
| 95 | 95 | t.deepEqual(results, { | |
| 96 | - javascript: 3, | ||
| 96 | + javascript: 9, | ||
| 97 | 97 | }); | |
| 98 | 98 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + name: Pack testing in the CodeQL Action | ||
| 2 | + | ||
| 3 | + disable-default-queries: true | ||
| 4 | + packs: | ||
| 5 | + javascript: | ||
| 6 | + - dsp-testing/codeql-pack1@0.0.1 | ||
| 7 | + - dsp-testing/codeql-pack2 # latest | ||
| 8 | + paths-ignore: | ||
| 9 | + - tests | ||
| 10 | + - lib | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,12 @@ | |||
| 1 | 1 | if (true) { | |
| 2 | 2 | console.log("Hello, World!"); | |
| 3 | + console.log("Good-bye, World!"); | ||
| 4 | + } | ||
| 5 | + | ||
| 6 | + if (true) { | ||
| 7 | + console.log("Hello, World!"); | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + if (true) { | ||
| 11 | + // empty | ||
| 3 | 12 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments