Skip to content

Commit 9ded5b8

Browse files
authored
Merge pull request github#12942 from github/henrymercer/update-diagnostics-integration-tests
C#: Update diagnostics integration tests
2 parents 21a00f9 + 0040025 commit 9ded5b8

File tree

8 files changed

+7
-53
lines changed

8 files changed

+7
-53
lines changed

csharp/ql/integration-tests/all-platforms/diag_dotnet_incompatible/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL found some projects which cannot be built with .NET Core:\n\n- `test.csproj`",
63
"severity": "warning",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL was unable to build the following projects using MSBuild:\n\n- `test.csproj`\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {

csharp/ql/integration-tests/all-platforms/diag_missing_project_files/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL was unable to build the following projects using MSBuild:\n\n- `test.sln`\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "Some project files were not found when CodeQL built your project:\n\n- `Example.csproj`\n- `Example.Test.csproj`\n\nThis may lead to subsequent failures. You can check for common causes for missing project files:\n\n- Ensure that the project is built using the [intended operating system](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on) and that filenames on case-sensitive platforms are correctly specified.\n- If your repository uses Git submodules, ensure that those are [checked out](https://github.com/actions/checkout#usage) before the CodeQL Action is run.\n- If you auto-generate some project files as part of your build process, ensure that these are generated before the CodeQL Action is run.",
2317
"severity": "error",
2418
"source": {

csharp/ql/integration-tests/all-platforms/diag_missing_xamarin_sdk/diagnostics.expected

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL was unable to build the following projects using .NET Core:\n\n- `test.csproj`\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL was unable to build the following projects using MSBuild:\n\n- `test.csproj`\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {
@@ -33,9 +27,6 @@
3327
}
3428
}
3529
{
36-
"attributes": {},
37-
"helpLinks": [],
38-
"internal": false,
3930
"markdownMessage": "[Configure your workflow](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-xamarin-applications) for this SDK before running CodeQL.",
4031
"severity": "error",
4132
"source": {

csharp/ql/integration-tests/all-platforms/dotnet_run/test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from create_database_utils import *
32
from diagnostics_test_utils import *
43

@@ -22,35 +21,35 @@ def check_build_out(msg, s):
2221
# no arguments, but `--`
2322
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test-db', 'dotnet run --'], "test2-db")
2423
check_build_out("Default reply", s)
25-
check_diagnostics(diagnostics_dir="test2-db/diagnostic")
24+
check_diagnostics(test_db="test2-db")
2625

2726
# one argument, no `--`
2827
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test2-db', 'dotnet run hello'], "test3-db")
2928
check_build_out("Default reply", s)
30-
check_diagnostics(diagnostics_dir="test3-db/diagnostic")
29+
check_diagnostics(test_db="test3-db")
3130

3231
# one argument, but `--`
3332
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test3-db', 'dotnet run -- hello'], "test4-db")
3433
check_build_out("Default reply", s)
35-
check_diagnostics(diagnostics_dir="test4-db/diagnostic")
34+
check_diagnostics(test_db="test4-db")
3635

3736
# two arguments, no `--`
3837
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test4-db', 'dotnet run hello world'], "test5-db")
3938
check_build_out("hello, world", s)
40-
check_diagnostics(diagnostics_dir="test5-db/diagnostic")
39+
check_diagnostics(test_db="test5-db")
4140

4241
# two arguments, and `--`
4342
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test5-db', 'dotnet run -- hello world'], "test6-db")
4443
check_build_out("hello, world", s)
45-
check_diagnostics(diagnostics_dir="test6-db/diagnostic")
44+
check_diagnostics(test_db="test6-db")
4645

4746
# shared compilation enabled; tracer should override by changing the command
4847
# to `dotnet run -p:UseSharedCompilation=true -p:UseSharedCompilation=false -- hello world`
4948
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test6-db', 'dotnet run -p:UseSharedCompilation=true -- hello world'], "test7-db")
5049
check_build_out("hello, world", s)
51-
check_diagnostics(diagnostics_dir="test7-db/diagnostic")
50+
check_diagnostics(test_db="test7-db")
5251

5352
# option passed into `dotnet run`
5453
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test7-db', 'dotnet build', 'dotnet run --no-build hello world'], "test8-db")
5554
check_build_out("hello, world", s)
56-
check_diagnostics(diagnostics_dir="test8-db/diagnostic")
55+
check_diagnostics(test_db="test8-db")

csharp/ql/integration-tests/posix-only/diag_autobuild_script/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL attempted to build your project using a script located at `build.sh`, which failed.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL could not find any project or solution files in your repository.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {

csharp/ql/integration-tests/posix-only/diag_multiple_scripts/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL could not find any project or solution files in your repository.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL found multiple potential build scripts for your project and attempted to run `build.sh`, which failed. This may not be the right build script for your project.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {

csharp/ql/integration-tests/windows-only/diag_autobuild_script/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL attempted to build your project using a script located at `build.bat`, which failed.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL could not find any project or solution files in your repository.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {

csharp/ql/integration-tests/windows-only/diag_multiple_scripts/diagnostics.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"attributes": {},
3-
"helpLinks": [],
4-
"internal": false,
52
"markdownMessage": "CodeQL could not find any project or solution files in your repository.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
63
"severity": "error",
74
"source": {
@@ -16,9 +13,6 @@
1613
}
1714
}
1815
{
19-
"attributes": {},
20-
"helpLinks": [],
21-
"internal": false,
2216
"markdownMessage": "CodeQL found multiple potential build scripts for your project and attempted to run `build.bat`, which failed. This may not be the right build script for your project.\n\nSet up a [manual build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).",
2317
"severity": "error",
2418
"source": {

0 commit comments

Comments
 (0)