Skip to content

Commit ff20bce

Browse files
Add test cases of non-MRVA areas
1 parent 5edbb1e commit ff20bce

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

docs/test-plan.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,58 @@ choose to go through some of the Optional Test Cases.
1818

1919
## Required Test Cases
2020

21+
### Local databases
22+
23+
#### Test case 1: Download a database from GitHub
24+
25+
1. Click "Download Database from GitHub" and enter `angular-cn/ng-nice` and select the javascript language if prompted
26+
27+
#### Test case 2: Import a database from an archive
28+
29+
1. Obtain a javascript database for `babel/babel`
30+
- You can do `gh api "/repos/babel/babel/code-scanning/codeql/databases/javascript" -H "Accept: application/zip" > babel.zip` to fetch a database from GitHub.
31+
2. Click "Choose Database from Archive" and select the file you just downloaded above.
32+
33+
### Local queries
34+
35+
#### Test case 1: Running a path problem query and viewing results
36+
37+
1. Open the [javascript UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
38+
2. Select the `angular-cn/ng-nice` database (or download it if you don't have one already)
39+
3. Run a local query.
40+
4. Once the query completes:
41+
- Check that the result messages are rendered
42+
- Check that the paths can be opened and paths are rendered correctly
43+
- Check that alert locations can be clicked on
44+
45+
#### Test case 2: Running a problem query and viewing results
46+
47+
1. Open the [javascript UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
48+
2. Select the `babel/babel` database (or download it if you don't have one already)
49+
3. Run a local query.
50+
4. Once the query completes:
51+
- Check that the result messages are rendered
52+
- Check that alert locations can be clicked on
53+
54+
#### Test case 3: Running a non-probem query and viewing results
55+
56+
1. Open the [cpp FunLinesOfCode query](https://github.com/github/codeql/blob/main/cpp/ql/src/Metrics/Functions/FunLinesOfCode.ql).
57+
2. Select the `google/brotli` database (or download it if you don't have one already)
58+
3. Run a local query.
59+
4. Once the query completes:
60+
- Check that the results table is rendered
61+
- Check that alert locations can be clicked on
62+
63+
#### Test case 3: Can use AST viewer
64+
65+
1. Click on any code location from a previous query to open a source file from a database
66+
2. Open the AST viewing panel and click "View AST"
67+
3. Once the AST is computed:
68+
- Check that it can be navigated
69+
2170
### MRVA
2271

23-
#### Test Case 1: Running a problem path query and viewing results
72+
#### Test Case 1: Running a path problem query and viewing results
2473

2574
1. Open the [javascript UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
2675
2. Run a MRVA against the following repo list:

0 commit comments

Comments
 (0)