diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4708970..efc7969 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -62,8 +62,7 @@ jobs: run: npm run compile - name: Run integration tests - working-directory: integration - run: EXHORT_ITS_USE_REAL_API=true bash ./run_its.sh + run: npm run integration-tests - name: Upload coverage reports if: ${{ matrix.node == env.MAIN_NODE_VER }} diff --git a/package-lock.json b/package-lock.json index cea1905..bdcd176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "eslint": "^8.42.0", "eslint-plugin-editorconfig": "^4.0.3", "mocha": "^10.2.0", - "msw": "^1.2.2", + "msw": "^1.3.2", "sinon": "^15.1.2", "sinon-chai": "^3.7.0", "typescript": "^5.1.3" @@ -270,16 +270,16 @@ } }, "node_modules/@mswjs/interceptors": { - "version": "0.17.9", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.17.9.tgz", - "integrity": "sha512-4LVGt03RobMH/7ZrbHqRxQrS9cc2uh+iNKSj8UWr8M26A2i793ju+csaB5zaqYltqJmA2jUq4VeYfKmVqvsXQg==", + "version": "0.17.10", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.17.10.tgz", + "integrity": "sha512-N8x7eSLGcmUFNWZRxT1vsHvypzIRgQYdG0rJey/rZCy6zT/30qDt8Joj7FxzGNLSwXbeZqJOMqDurp7ra4hgbw==", "dev": true, "dependencies": { "@open-draft/until": "^1.0.3", "@types/debug": "^4.1.7", "@xmldom/xmldom": "^0.8.3", "debug": "^4.3.3", - "headers-polyfill": "^3.1.0", + "headers-polyfill": "3.2.5", "outvariant": "^1.2.1", "strict-event-emitter": "^0.2.4", "web-encoding": "^1.1.5" @@ -664,9 +664,9 @@ "dev": true }, "node_modules/@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", + "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==", "dev": true, "dependencies": { "@types/ms": "*" @@ -685,9 +685,9 @@ "dev": true }, "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==", "dev": true }, "node_modules/@types/node": { @@ -706,9 +706,9 @@ } }, "node_modules/@xmldom/xmldom": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.8.tgz", - "integrity": "sha512-0LNz4EY8B/8xXY86wMrQ4tz6zEHZv9ehFMJPm8u2gq5lQ71cfRKdaKyxfJAx5aUoyzx0qzgURblTisPGgz3d+Q==", + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", + "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -2155,10 +2155,13 @@ "devOptional": true }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gauge": { "version": "3.0.2", @@ -2284,22 +2287,19 @@ "dev": true }, "node_modules/graphql": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", - "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { "node": ">= 0.4.0" } @@ -2368,9 +2368,9 @@ } }, "node_modules/headers-polyfill": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.1.2.tgz", - "integrity": "sha512-tWCK4biJ6hcLqTviLXVR9DTRfYGQMXEIUj3gwJ2rZ5wO/at3XtkI4g8mCvFdUF9l1KMBNCfmNAdnahm1cgavQA==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", + "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==", "dev": true }, "node_modules/html-escaper": { @@ -2627,16 +2627,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -3105,22 +3101,22 @@ "devOptional": true }, "node_modules/msw": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/msw/-/msw-1.2.2.tgz", - "integrity": "sha512-GsW3PE/Es/a1tYThXcM8YHOZ1S1MtivcS3He/LQbbTCx3rbWJYCtWD5XXyJ53KlNPT7O1VI9sCW3xMtgFe8XpQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/msw/-/msw-1.3.2.tgz", + "integrity": "sha512-wKLhFPR+NitYTkQl5047pia0reNGgf0P6a1eTnA5aNlripmiz0sabMvvHcicE8kQ3/gZcI0YiPFWmYfowfm3lA==", "dev": true, "hasInstallScript": true, "dependencies": { "@mswjs/cookies": "^0.2.2", - "@mswjs/interceptors": "^0.17.5", + "@mswjs/interceptors": "^0.17.10", "@open-draft/until": "^1.0.3", "@types/cookie": "^0.4.1", "@types/js-levenshtein": "^1.1.1", - "chalk": "4.1.1", + "chalk": "^4.1.1", "chokidar": "^3.4.2", "cookie": "^0.4.2", - "graphql": "^15.0.0 || ^16.0.0", - "headers-polyfill": "^3.1.2", + "graphql": "^16.8.1", + "headers-polyfill": "3.2.5", "inquirer": "^8.2.0", "is-node-process": "^1.2.0", "js-levenshtein": "^1.1.6", @@ -3142,7 +3138,7 @@ "url": "https://opencollective.com/mswjs" }, "peerDependencies": { - "typescript": ">= 4.4.x <= 5.1.x" + "typescript": ">= 4.4.x <= 5.2.x" }, "peerDependenciesMeta": { "typescript": { @@ -3150,22 +3146,6 @@ } } }, - "node_modules/msw/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/msw/node_modules/path-to-regexp": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", diff --git a/package.json b/package.json index 612e9df..8a97121 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,9 @@ "lint:fix": "eslint src test --ext js --fix", "test": "c8 npm run tests", "localtest": "EXHORT_PIP3_PATH=/home/zgrinber/python3.9/bin/pip3 EXHORT_PYTHON3_PATH=/home/zgrinber/python3.9/bin/python3 c8 npm run tests", - "tests": "mocha", + "tests": "mocha --grep \"Integration Tests|.*analysis module.*\" --invert", "tests:rep": "mocha --reporter-option maxDiffSize=0 --reporter json > unit-tests-result.json", + "integration-tests": "mocha --grep \"Integration Tests\"", "precompile": "rm -rf dist", "compile": "tsc -p tsconfig.json", "pregen:backend": "rm -rf generated", @@ -58,7 +59,7 @@ "eslint": "^8.42.0", "eslint-plugin-editorconfig": "^4.0.3", "mocha": "^10.2.0", - "msw": "^1.2.2", + "msw": "^1.3.2", "sinon": "^15.1.2", "sinon-chai": "^3.7.0", "typescript": "^5.1.3" @@ -80,7 +81,8 @@ ], "exclude": [ "src/cli.js", - "src/index.js" + "src/index.js", + "src/analysis.js" ], "lines": 85, "reporter": [ diff --git a/test/it/end-to-end.js b/test/it/end-to-end.js new file mode 100644 index 0000000..775de05 --- /dev/null +++ b/test/it/end-to-end.js @@ -0,0 +1,101 @@ +import fs from "node:fs"; +// import {AnalysisReport} from '../../generated/backend/AnalysisReport.js' +import index from "../../src/index.js" +import { expect } from 'chai' +// import fs from 'node:fs' + +function getManifestNamePerPm(packageManager) { + return packageManagersDict[packageManager]; +} + +const packageManagersDict = + { + "maven" : "pom.xml", + "npm" : "package.json", + "go" : "go.mod", + "pip" : "requirements.txt" + } + +function getParsedSummaryFromHtml(html) { + return JSON.parse(html.substring(html.indexOf("\"summary\"") + 10,html.indexOf("\"}]}") + 4)); +} + +suite('Integration Tests', () => { + // let opts = { + // EXHORT_DEV_MODE: "true", + // EXHORT_SNYK_TOKEN: "ee64316c-a4ba-4ca0-a785-18cb05ed3f25" + // + // } + ["maven", + "npm", + "go", + "pip" + ].forEach(packageManager => { + test(`Stack Analysis json for ${packageManager}`, async () => { + // process.env["EXHORT_DEBUG"]= "true" + // process.env["EXHORT_DEV_MODE"]= "false" + // process.env["EXHORT_GO_PATH"]= "/home/zgrinber/test-go/go/bin/go" + // process.env["RHDA_TOKEN"] = "34JKLDS-4234809-66666666666" + // process.env["RHDA_SOURCE"] = "Zvika Client" + // let result = await index.stackAnalysis("/tmp/rajan-0410/go.mod", false, opts); + if(packageManager === "pip") + { + process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "true" + } + else + { + process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "" + } + let manifestName = getManifestNamePerPm(packageManager) + let pomPath = `test/it/test_manifests/${packageManager}/${manifestName}` + let providedDataForStack = await index.stackAnalysis(pomPath) + console.log(JSON.stringify(providedDataForStack.summary,null , 4)) + expect(providedDataForStack.summary.dependencies.scanned).greaterThan(0) + // python transitive count for stack analysis is awaiting fix in exhort backend + if(packageManager !== "pip") + { + expect(providedDataForStack.summary.dependencies.transitive).greaterThan(0) + } + expect(providedDataForStack.summary.vulnerabilities.total).greaterThanOrEqual(0) + providedDataForStack.summary.providerStatuses.forEach(provider => expect(provider.status).equals(200)) + }).timeout(15000); + + test(`Stack Analysis html for ${packageManager}`, async () => { + let manifestName = getManifestNamePerPm(packageManager) + let pomPath = `test/it/test_manifests/${packageManager}/${manifestName}` + let html = await index.stackAnalysis(pomPath,true) + if(packageManager === "pip") + { + process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "true" + } + else + { + process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "" + } + let parsedSummaryFromHtml = getParsedSummaryFromHtml(html); + expect( typeof html).equals("string") + expect(html).include("html").include("svg") + expect(parsedSummaryFromHtml.dependencies.scanned).greaterThan(0) + // python transitive count for stack analysis is awaiting fix in exhort backend + if(packageManager !== "pip") + { + expect(parsedSummaryFromHtml.dependencies.transitive).greaterThan(0) + } + expect(parsedSummaryFromHtml.vulnerabilities.total).greaterThanOrEqual(0) + parsedSummaryFromHtml.providerStatuses.forEach(provider => expect(provider.status).equals(200)) + }).timeout(15000); + + test(`Component Analysis for ${packageManager}`, async () => { + let manifestName = getManifestNamePerPm(packageManager) + let pomPath = `test/it/test_manifests/${packageManager}/${manifestName}` + let analysisReport = await index.componentAnalysis(manifestName,fs.readFileSync(pomPath).toString()) + + expect(analysisReport.summary.dependencies.scanned).greaterThan(0) + expect(analysisReport.summary.dependencies.transitive).equal(0) + expect(analysisReport.summary.vulnerabilities.total).greaterThanOrEqual(0) + analysisReport.summary.providerStatuses.forEach(provider => expect(provider.status).equals(200)) + }).timeout(10000); + + + }); +}); diff --git a/test/it/test_manifests/go/go.mod b/test/it/test_manifests/go/go.mod new file mode 100644 index 0000000..c6911e8 --- /dev/null +++ b/test/it/test_manifests/go/go.mod @@ -0,0 +1,10 @@ +module github.com/test-golang-namespace/test-golang-app + +go 1.19 + +require( + + github.com/gin-gonic/gin v1.6.0 + github.com/ipld/go-car v0.3.0 + go.elastic.co/apm v1.11.0 +) diff --git a/test/it/test_manifests/maven/pom.xml b/test/it/test_manifests/maven/pom.xml new file mode 100644 index 0000000..423c98b --- /dev/null +++ b/test/it/test_manifests/maven/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + pom-with-deps-no-ignore + pom-with-dependency-not-ignored-for-tests + 0.0.1 + + + + log4j + log4j + 1.2.17 + + + + org.projectlombok + lombok + 1.16.6 + + + + com.fasterxml.jackson.core + jackson-databind + 2.14.0 + + + + diff --git a/test/it/test_manifests/npm/package-lock.json b/test/it/test_manifests/npm/package-lock.json new file mode 100644 index 0000000..cbb3d39 --- /dev/null +++ b/test/it/test_manifests/npm/package-lock.json @@ -0,0 +1,96 @@ +{ + "name": "test-app", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "test-app", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@hapi/joi": "^17.1.1", + "axios": "^0.19.0" + } + }, + "node_modules/@hapi/address": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.1.0.tgz", + "integrity": "sha512-SkszZf13HVgGmChdHo/PxchnSaCJ6cetVqLzyciudzZRT0jcOouIF/Q93mgjw8cce+D+4F4C1Z/WrfFN+O3VHQ==", + "deprecated": "Moved to 'npm install @sideway/address'", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@hapi/formula": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", + "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==", + "deprecated": "Moved to 'npm install @sideway/formula'" + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + }, + "node_modules/@hapi/joi": { + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-17.1.1.tgz", + "integrity": "sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==", + "deprecated": "Switch to 'npm install joi'", + "dependencies": { + "@hapi/address": "^4.0.1", + "@hapi/formula": "^2.0.0", + "@hapi/hoek": "^9.0.0", + "@hapi/pinpoint": "^2.0.0", + "@hapi/topo": "^5.0.0" + } + }, + "node_modules/@hapi/pinpoint": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.1.tgz", + "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "deprecated": "Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410", + "dependencies": { + "follow-redirects": "1.5.10" + } + }, + "node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "dependencies": { + "debug": "=3.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } +} diff --git a/test/it/test_manifests/npm/package.json b/test/it/test_manifests/npm/package.json new file mode 100644 index 0000000..7e26367 --- /dev/null +++ b/test/it/test_manifests/npm/package.json @@ -0,0 +1,16 @@ +{ + "name": "test-app", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node app.js", + "server": "nodemon server.js" + }, + "keywords": [], + "license": "ISC", + "dependencies": { + "@hapi/joi": "^17.1.1", + "axios": "^0.19.0" + } +} diff --git a/test/it/test_manifests/pip/requirements.txt b/test/it/test_manifests/pip/requirements.txt new file mode 100644 index 0000000..e55220b --- /dev/null +++ b/test/it/test_manifests/pip/requirements.txt @@ -0,0 +1,3 @@ +anyio==3.6.2 +click==8.0.4 +Flask==2.0.3 diff --git a/test/providers/python_pip.test.js b/test/providers/python_pip.test.js index 861dd98..022d116 100644 --- a/test/providers/python_pip.test.js +++ b/test/providers/python_pip.test.js @@ -77,7 +77,7 @@ suite('testing the python-pip data provider', () => { // load the expected sbom stack analysis let expectedSbom = fs.readFileSync(`test/providers/tst_manifests/pip/${testCase}/expected_stack_sbom.json`,).toString() process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "true" - process.env["EXHORT_DEBUG"] = "true" + // process.env["EXHORT_DEBUG"] = "true" expectedSbom = JSON.stringify(JSON.parse(expectedSbom),null , 4) // invoke sut stack analysis for scenario manifest let providedDataForStack = await pythonPip.provideStack(`test/providers/tst_manifests/pip/${testCase}/requirements.txt`)