diff --git a/csharp/ql/integration-tests/posix-only/diag_autobuild_script/build.sh b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/build.sh new file mode 100755 index 00000000000..2bb8d868bd0 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 1 diff --git a/csharp/ql/integration-tests/posix-only/diag_autobuild_script/diagnostics.expected b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/diagnostics.expected new file mode 100644 index 00000000000..69bcf765eee --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/diagnostics.expected @@ -0,0 +1,32 @@ +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/script-failure", + "name": "Unable to build project using build script" + }, + "visibility": { + "statusPage": true + } +} +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/no-projects-or-solutions", + "name": "No project or solutions files found" + }, + "visibility": { + "statusPage": true + } +} diff --git a/csharp/ql/integration-tests/posix-only/diag_autobuild_script/test.py b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/test.py new file mode 100644 index 00000000000..62c4d3934a4 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_autobuild_script/test.py @@ -0,0 +1,5 @@ +from create_database_utils import * +from diagnostics_test_utils import * + +run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully) +check_diagnostics() diff --git a/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/build.sh b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/build.sh new file mode 100755 index 00000000000..2bb8d868bd0 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 1 diff --git a/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/diagnostics.expected b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/diagnostics.expected new file mode 100644 index 00000000000..253ef636fd1 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/diagnostics.expected @@ -0,0 +1,32 @@ +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/multiple-build-scripts", + "name": "There are multiple potential build scripts" + }, + "visibility": { + "statusPage": true + } +} +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/no-projects-or-solutions", + "name": "No project or solutions files found" + }, + "visibility": { + "statusPage": true + } +} diff --git a/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/scripts/build.sh b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/scripts/build.sh new file mode 100755 index 00000000000..2bb8d868bd0 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/scripts/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 1 diff --git a/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/test.py b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/test.py new file mode 100644 index 00000000000..62c4d3934a4 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/diag_multiple_scripts/test.py @@ -0,0 +1,5 @@ +from create_database_utils import * +from diagnostics_test_utils import * + +run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully) +check_diagnostics() diff --git a/csharp/ql/integration-tests/windows-only/diag_autobuild_script/build.bat b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/build.bat new file mode 100644 index 00000000000..8f7ce95c0eb --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/build.bat @@ -0,0 +1 @@ +exit /b 1 diff --git a/csharp/ql/integration-tests/windows-only/diag_autobuild_script/diagnostics.expected b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/diagnostics.expected new file mode 100644 index 00000000000..a5096fcbf7b --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/diagnostics.expected @@ -0,0 +1,32 @@ +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/script-failure", + "name": "Unable to build project using build script" + }, + "visibility": { + "statusPage": true + } +} +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/no-projects-or-solutions", + "name": "No project or solutions files found" + }, + "visibility": { + "statusPage": true + } +} diff --git a/csharp/ql/integration-tests/windows-only/diag_autobuild_script/test.py b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/test.py new file mode 100644 index 00000000000..62c4d3934a4 --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_autobuild_script/test.py @@ -0,0 +1,5 @@ +from create_database_utils import * +from diagnostics_test_utils import * + +run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully) +check_diagnostics() diff --git a/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/build.bat b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/build.bat new file mode 100644 index 00000000000..8f7ce95c0eb --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/build.bat @@ -0,0 +1 @@ +exit /b 1 diff --git a/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/diagnostics.expected b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/diagnostics.expected new file mode 100644 index 00000000000..91815aa78af --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/diagnostics.expected @@ -0,0 +1,32 @@ +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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. 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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/multiple-build-scripts", + "name": "There are multiple potential build scripts" + }, + "visibility": { + "statusPage": true + } +} +{ + "attributes": {}, + "helpLinks": [], + "internal": false, + "location": {}, + "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).", + "severity": "error", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/no-projects-or-solutions", + "name": "No project or solutions files found" + }, + "visibility": { + "statusPage": true + } +} diff --git a/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/scripts/build.bat b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/scripts/build.bat new file mode 100644 index 00000000000..8f7ce95c0eb --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/scripts/build.bat @@ -0,0 +1 @@ +exit /b 1 diff --git a/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/test.py b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/test.py new file mode 100644 index 00000000000..62c4d3934a4 --- /dev/null +++ b/csharp/ql/integration-tests/windows-only/diag_multiple_scripts/test.py @@ -0,0 +1,5 @@ +from create_database_utils import * +from diagnostics_test_utils import * + +run_codeql_database_create([], db=None, lang="csharp", runFunction=runUnsuccessfully) +check_diagnostics()