Add integration test for missing nuget package sources

This commit is contained in:
Tamas Vajk
2024-02-12 10:27:05 +01:00
parent 566351a49a
commit 933a8e648d
9 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import csharp
private string getPath(Assembly a) {
not a.getCompilation().getOutputAssembly() = a and
exists(string s | s = a.getFile().getAbsolutePath() |
result =
s.substring(s.indexOf("test-db/working/") + "test-db/working/".length() + 16 +
"/legacypackages".length(), s.length())
// TODO: include all other assemblies from the test results. Initially disable because mono installations were problematic on ARM runners.
)
}
from Assembly a
select getPath(a)

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Remove all nuget package sources to force adding the default feed in the extraction root. -->
<clear />
</packageSources>
</configuration>

View File

@@ -0,0 +1,6 @@
class Program
{
static void Main(string[] args)
{
}
}

View File

@@ -0,0 +1,5 @@
{
"sdk": {
"version": "8.0.101"
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1 @@
Skipping the test on the ARM runners, as we're running into trouble with Mono and nuget.

View File

@@ -0,0 +1,3 @@
from create_database_utils import *
run_codeql_database_create([], source="proj", lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"])