Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/model-pack-results-table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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:
![Model packs results table for `psf/requests`](images/model-pack-results-table.png)

### CodeQL Model Editor

#### Test Case 1: Opening the model editor
Expand Down