diff --git a/docs/images/model-pack-results-table.png b/docs/images/model-pack-results-table.png new file mode 100644 index 000000000..d2e48102f Binary files /dev/null and b/docs/images/model-pack-results-table.png differ diff --git a/docs/test-plan.md b/docs/test-plan.md index 68356aa57..6ce561d57 100644 --- a/docs/test-plan.md +++ b/docs/test-plan.md @@ -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