Skip to content

Commit 7de2655

Browse files
committed
Add tests for build script diagnostics
1 parent bdbcaab commit 7de2655

File tree

14 files changed

+160
-0
lines changed

14 files changed

+160
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exit 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"attributes": {},
3+
"helpLinks": [],
4+
"internal": false,
5+
"location": {},
6+
"markdownMessage": "CodeQL attempted to build your project using a script located at `build.sh`, which failed. Set 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).",
7+
"severity": "error",
8+
"source": {
9+
"extractorName": "csharp",
10+
"id": "csharp/autobuilder/script-failure",
11+
"name": "Unable to build project using build script"
12+
},
13+
"visibility": {
14+
"statusPage": true
15+
}
16+
}
17+
{
18+
"attributes": {},
19+
"helpLinks": [],
20+
"internal": false,
21+
"location": {},
22+
"plaintextMessage": "CodeQL could not find any project or solution files in your repository. Set 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).",
23+
"severity": "error",
24+
"source": {
25+
"extractorName": "csharp",
26+
"id": "csharp/autobuilder/no-projects-or-solutions",
27+
"name": "No project or solutions files found"
28+
},
29+
"visibility": {
30+
"statusPage": true
31+
}
32+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from create_database_utils import *
2+
from diagnostics_test_utils import *
3+
4+
run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully)
5+
check_diagnostics()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exit 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"attributes": {},
3+
"helpLinks": [],
4+
"internal": false,
5+
"location": {},
6+
"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. Set 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).",
7+
"severity": "error",
8+
"source": {
9+
"extractorName": "csharp",
10+
"id": "csharp/autobuilder/multiple-build-scripts",
11+
"name": "There are multiple potential build scripts"
12+
},
13+
"visibility": {
14+
"statusPage": true
15+
}
16+
}
17+
{
18+
"attributes": {},
19+
"helpLinks": [],
20+
"internal": false,
21+
"location": {},
22+
"plaintextMessage": "CodeQL could not find any project or solution files in your repository. Set 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).",
23+
"severity": "error",
24+
"source": {
25+
"extractorName": "csharp",
26+
"id": "csharp/autobuilder/no-projects-or-solutions",
27+
"name": "No project or solutions files found"
28+
},
29+
"visibility": {
30+
"statusPage": true
31+
}
32+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exit 1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from create_database_utils import *
2+
from diagnostics_test_utils import *
3+
4+
run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully)
5+
check_diagnostics()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exit /b 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"attributes": {},
3+
"helpLinks": [],
4+
"internal": false,
5+
"location": {},
6+
"markdownMessage": "CodeQL attempted to build your project using a script located at `build.bat`, which failed. Set 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).",
7+
"severity": "error",
8+
"source": {
9+
"extractorName": "csharp",
10+
"id": "csharp/autobuilder/script-failure",
11+
"name": "Unable to build project using build script"
12+
},
13+
"visibility": {
14+
"statusPage": true
15+
}
16+
}
17+
{
18+
"attributes": {},
19+
"helpLinks": [],
20+
"internal": false,
21+
"location": {},
22+
"plaintextMessage": "CodeQL could not find any project or solution files in your repository. Set 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).",
23+
"severity": "error",
24+
"source": {
25+
"extractorName": "csharp",
26+
"id": "csharp/autobuilder/no-projects-or-solutions",
27+
"name": "No project or solutions files found"
28+
},
29+
"visibility": {
30+
"statusPage": true
31+
}
32+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from create_database_utils import *
2+
from diagnostics_test_utils import *
3+
4+
run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully)
5+
check_diagnostics()

0 commit comments

Comments
 (0)