From b2ab4c0f356b71f5c39dc5d656e07d31ecf5753a Mon Sep 17 00:00:00 2001 From: Georgiana-Elena Maxim <136567038+gemaxim@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:31:13 +0200 Subject: [PATCH] fix: bump snyk python plugin (#4971) --- package-lock.json | 14 +++++++------- package.json | 2 +- .../snyk-test/basic-test-all-languages.spec.ts | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 258e07b20f..ea673257f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,7 @@ "snyk-nuget-plugin": "2.3.3", "snyk-php-plugin": "1.9.2", "snyk-policy": "^1.25.0", - "snyk-python-plugin": "^2.0.5", + "snyk-python-plugin": "^2.0.6", "snyk-resolve-deps": "4.7.3", "snyk-sbt-plugin": "2.17.1", "snyk-swiftpm-plugin": "1.4.1", @@ -20773,9 +20773,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/snyk-python-plugin": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/snyk-python-plugin/-/snyk-python-plugin-2.0.5.tgz", - "integrity": "sha512-IEOsb6jBGgk533ydbqHJwF3OI/Mre6ImSKTmajU1Kz1rkeDxSW2/9N4KV1gcjxs/O8SkVptUwYndFG238yl+SA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/snyk-python-plugin/-/snyk-python-plugin-2.0.6.tgz", + "integrity": "sha512-Zw2GMIlcAyDwub7u9/W7ybKQrFZvd4HQYrhixua0+tlADSSSvpm2qoAB68qAsTLCKU5f509ByjdSfiUFaSmp5w==", "dependencies": { "@snyk/cli-interface": "^2.11.2", "@snyk/dep-graph": "^1.28.1", @@ -39966,9 +39966,9 @@ } }, "snyk-python-plugin": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/snyk-python-plugin/-/snyk-python-plugin-2.0.5.tgz", - "integrity": "sha512-IEOsb6jBGgk533ydbqHJwF3OI/Mre6ImSKTmajU1Kz1rkeDxSW2/9N4KV1gcjxs/O8SkVptUwYndFG238yl+SA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/snyk-python-plugin/-/snyk-python-plugin-2.0.6.tgz", + "integrity": "sha512-Zw2GMIlcAyDwub7u9/W7ybKQrFZvd4HQYrhixua0+tlADSSSvpm2qoAB68qAsTLCKU5f509ByjdSfiUFaSmp5w==", "requires": { "@snyk/cli-interface": "^2.11.2", "@snyk/dep-graph": "^1.28.1", diff --git a/package.json b/package.json index 5014a233bc..9b1cb3df23 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "snyk-nuget-plugin": "2.3.3", "snyk-php-plugin": "1.9.2", "snyk-policy": "^1.25.0", - "snyk-python-plugin": "^2.0.5", + "snyk-python-plugin": "^2.0.6", "snyk-resolve-deps": "4.7.3", "snyk-sbt-plugin": "2.17.1", "snyk-swiftpm-plugin": "1.4.1", diff --git a/test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts b/test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts index 358901c360..28146ad000 100644 --- a/test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts +++ b/test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts @@ -117,6 +117,23 @@ describe('`snyk test` of basic projects for each language/ecosystem', () => { expect(code).toEqual(0); }); + test('fails `snyk test` on a python project with wrong command exits with code 2', async () => { + const project = await createProjectFromWorkspace('pip-app'); + let wrongPythonCommand = 'pthon'; + + await runCommand(wrongPythonCommand, ['--version']).catch(function() { + wrongPythonCommand = 'pthon3'; + }); + + const result = await runSnykCLI('test -d --command=' + wrongPythonCommand, { + cwd: project.path(), + env, + }); + + expect(result.code).toEqual(2); + expect(result.stderr).toMatch(wrongPythonCommand); + }); + test('run `snyk test` on a gradle project', async () => { const project = await createProjectFromWorkspace('gradle-app');