Add test for model packs in MRVA to test plan
This commit is contained in:
BIN
docs/images/model-pack-results-table.png
Normal file
BIN
docs/images/model-pack-results-table.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -145,6 +145,48 @@ Run one of the above MRVAs, but cancel it from within VS Code:
|
|||||||
- Check that the workflow run is also canceled.
|
- Check that the workflow run is also canceled.
|
||||||
- Check that any available results are visible in VS Code.
|
- Check that any available results are visible in VS Code.
|
||||||
|
|
||||||
|
#### Test Case 6: Using model packs in MRVA
|
||||||
|
|
||||||
|
1. Create a model pack with mock data
|
||||||
|
1. Create a new directory `test-model-pack`
|
||||||
|
2. Create a `qlpack.yml` file in that directory with the following contents:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: github/test-model-pack
|
||||||
|
version: 0.0.0
|
||||||
|
library: true
|
||||||
|
extensionTargets:
|
||||||
|
codeql/python-all: '*'
|
||||||
|
dataExtensions:
|
||||||
|
- extension.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create an `extension.yml` in the same directory with the following contents:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
extensions:
|
||||||
|
- addsTo:
|
||||||
|
pack: codeql/python-all
|
||||||
|
extensible: sinkModel
|
||||||
|
data:
|
||||||
|
- ["vscode-codeql","Member[initialize].Argument[0]","code-injection"]
|
||||||
|
```
|
||||||
|
|
||||||
|
2. In a Python query pack, create the following query (e.g. `sinks.ql`):
|
||||||
|
|
||||||
|
```ql
|
||||||
|
import python
|
||||||
|
import semmle.python.frameworks.data.internal.ApiGraphModelsExtensions
|
||||||
|
|
||||||
|
from string path, string kind
|
||||||
|
where sinkModel("vscode-codeql", path, kind)
|
||||||
|
select path, kind
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run a MRVA against a Python repository (e.g. `psf/requests`) with this query.
|
||||||
|
4. Check that the results view contains 1 result with the values corresponding to the `extension.yml` file:
|
||||||
|

|
||||||
|
|
||||||
### CodeQL Model Editor
|
### CodeQL Model Editor
|
||||||
|
|
||||||
#### Test Case 1: Opening the model editor
|
#### Test Case 1: Opening the model editor
|
||||||
|
|||||||
Reference in New Issue
Block a user