Skip to content

Commit

Permalink
test: debug
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <[email protected]>
  • Loading branch information
zvigrinberg committed Oct 4, 2023
1 parent 5e3e51f commit 261a7a7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/providers/python_pip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,21 @@ 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"
expectedSbom = JSON.stringify(JSON.parse(expectedSbom))
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`)
// new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date

// providedDataForStack.content = providedDataForStack.content.replaceAll("\"timestamp\":\"[a-zA-Z0-9\\-\\:]+\"","")
// verify returned data matches expectation
expect(providedDataForStack).to.deep.equal({
ecosystem: 'pip',
contentType: 'application/vnd.cyclonedx+json',
content: expectedSbom
})
providedDataForStack.content = JSON.stringify(JSON.parse(providedDataForStack.content),null , 4)
expect(providedDataForStack.content).to.deep.equal(expectedSbom)
// expect(providedDataForStack).to.deep.equal({
// ecosystem: 'pip',
// contentType: 'application/vnd.cyclonedx+json',
// content: expectedSbom
// })
// these test cases takes ~2500-2700 ms each pr >10000 in CI (for the first test-case)
}).timeout(process.env.GITHUB_ACTIONS ? 30000 : 15000)

Expand Down

0 comments on commit 261a7a7

Please sign in to comment.