Skip to content

Commit

Permalink
fix: [OSM-887] Bumping snyk-nuget-plugin for various bugfixes (#4961)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotkas committed Dec 12, 2023
1 parent 7e4accf commit 8e896fd
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 14 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"snyk-module": "3.1.0",
"snyk-mvn-plugin": "3.1.0",
"snyk-nodejs-lockfile-parser": "1.52.8",
"snyk-nuget-plugin": "2.3.0",
"snyk-nuget-plugin": "2.3.3",
"snyk-php-plugin": "1.9.2",
"snyk-policy": "^1.25.0",
"snyk-python-plugin": "^2.0.1",
Expand Down
4 changes: 4 additions & 0 deletions test/acceptance/workspaces/nuget-app-7-windows/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin/
obj/**
obj/**/
!*.assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>60</Version>
<TargetFramework>net7.0-windows</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"version": 3,
"targets": {
"net7.0-windows7.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net7.0-windows7.0": []
},
"packageFolders": {
"/Users/kasparmoss/.nuget/packages/": {}
},
"project": {
"version": "60.0.0",
"restore": {
"projectUniqueName": "/Users/kasparmoss/git/snyk/cli/test/acceptance/workspaces/nuget-app-7-windows/dotnet_7.csproj",
"projectName": "dotnet_7",
"projectPath": "/Users/kasparmoss/git/snyk/cli/test/acceptance/workspaces/nuget-app-7-windows/dotnet_7.csproj",
"packagesPath": "/Users/kasparmoss/.nuget/packages/",
"outputPath": "/Users/kasparmoss/git/snyk/cli/test/acceptance/workspaces/nuget-app-7-windows/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/kasparmoss/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0-windows"
],
"sources": {
"/usr/local/share/dotnet/library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0-windows7.0": {
"targetAlias": "net7.0-windows",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0-windows7.0": {
"targetAlias": "net7.0-windows",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[7.0.14, 7.0.14]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[7.0.14, 7.0.14]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.100/RuntimeIdentifierGraph.json"
}
}
}
}
8 changes: 8 additions & 0 deletions test/acceptance/workspaces/nuget-app-7-windows/program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;
class TestFixture {
static public void Main(String[] args)
{
var client = new System.Net.Http.HttpClient();
Console.WriteLine("Hello, World!");
}
}
4 changes: 2 additions & 2 deletions test/jest/acceptance/snyk-fix/fix.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
import { runCommand } from '../../util/runCommand';
import { runSnykCLI } from '../../util/runSnykCLI';

// Check for existance of pipenv in the environment
// Check for existence of pipenv in the environment
const hasPipEnv = spawnSync('pipenv', ['--version']).status === 0;

jest.setTimeout(1000 * 60);
jest.setTimeout(1000 * 80);
describe('snyk fix', () => {
let server: ReturnType<typeof fakeServer>;
let env: Record<string, string>;
Expand Down
20 changes: 16 additions & 4 deletions test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ describe('`snyk test` of basic projects for each language/ecosystem', () => {
{
fixture: 'nuget-app-6-no-rid',
},
{
fixture: 'nuget-app-7-windows',
},
])(
'run `snyk test` on a nuget project using v2 dotnet runtime resolution logic',
'run `snyk test` on a nuget project using v2 dotnet runtime resolution logic for $fixture',
async ({ fixture }) => {
const prerequisite = await runCommand('dotnet', ['--version']).catch(
function() {
Expand All @@ -188,9 +191,18 @@ describe('`snyk test` of basic projects for each language/ecosystem', () => {

const project = await createProjectFromWorkspace(fixture);

const { code } = await runSnykCLI('test -d --dotnet-runtime-resolution', {
cwd: project.path(),
});
const { code, stderr, stdout } = await runSnykCLI(
'test -d --dotnet-runtime-resolution',
{
cwd: project.path(),
},
);

if (code !== 0) {
console.debug(stderr);
console.debug('---------------------------');
console.debug(stdout);
}

expect(code).toEqual(0);
},
Expand Down

0 comments on commit 8e896fd

Please sign in to comment.