From 13d6f3876ee83e9485b4cdb5ba7ff2b4cb721f9d Mon Sep 17 00:00:00 2001 From: ghe Date: Wed, 5 Oct 2022 14:47:03 +0100 Subject: [PATCH 1/2] test: increase test timeouts again --- test/lib/get-dependencies-data.test.ts | 2 +- test/lib/get-license-data.test.ts | 2 +- test/system/generate.test.ts | 8 ++++---- test/system/json.test.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/lib/get-dependencies-data.test.ts b/test/lib/get-dependencies-data.test.ts index d0b46b7..38b6d20 100644 --- a/test/lib/get-dependencies-data.test.ts +++ b/test/lib/get-dependencies-data.test.ts @@ -15,6 +15,6 @@ describe('Get org dependencies', () => { test('License results are returned from API', async () => { const licenseRes = await getDependenciesDataForOrg(ORG_ID); expect(licenseRes.results.length > 0).toBeTruthy(); - }, 150000); + }, 200000); test.todo('Test for when API fails aka bad org id provided'); }); diff --git a/test/lib/get-license-data.test.ts b/test/lib/get-license-data.test.ts index 03f1478..cfe1def 100644 --- a/test/lib/get-license-data.test.ts +++ b/test/lib/get-license-data.test.ts @@ -15,7 +15,7 @@ describe('Get org licenses', () => { test('License results are returned from API', async () => { const licenseRes = await getDependenciesDataForOrg(ORG_ID); expect(licenseRes.results.length > 0).toBeTruthy(); - }, 150000); + }, 200000); test.todo('Test for when API fails aka bad org id provided'); }); diff --git a/test/system/generate.test.ts b/test/system/generate.test.ts index 2974489..2424d85 100644 --- a/test/system/generate.test.ts +++ b/test/system/generate.test.ts @@ -73,7 +73,7 @@ describe('`snyk-licenses-report generate <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it('generated the report successfully with project-dependencies view', (done) => { exec( @@ -90,7 +90,7 @@ describe('`snyk-licenses-report generate <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it.skip('generated the report successfully as PDF', (done) => { exec( @@ -107,7 +107,7 @@ describe('`snyk-licenses-report generate <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it('generated the report successfully with custom template', (done) => { exec( `node ${main} generate --orgPublicId=${ORG_ID} --template=${ @@ -125,7 +125,7 @@ describe('`snyk-licenses-report generate <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it.todo('API is down'); it.todo('Requested org has no licenses policy'); }); diff --git a/test/system/json.test.ts b/test/system/json.test.ts index b6535eb..5f223c9 100644 --- a/test/system/json.test.ts +++ b/test/system/json.test.ts @@ -20,7 +20,7 @@ describe('`snyk-licenses-report json <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it('Generated JSON data with correct --orgPublicId', async (done) => { exec( `node ${main} json --orgPublicId=${ORG_ID}`, @@ -36,7 +36,7 @@ describe('`snyk-licenses-report json <...>`', () => { done(); }, ); - }, 150000); + }, 200000); it('Generated JSON data with correct --orgPublicId --project', async (done) => { exec( `node ${main} json --orgPublicId=${ORG_ID} --project=${PROJECT_ID}}`, @@ -52,5 +52,5 @@ describe('`snyk-licenses-report json <...>`', () => { done(); }, ); - }, 150000); + }, 200000); }); From 6b88cf35ca3f2428660e41411629d6246b00679b Mon Sep 17 00:00:00 2001 From: ghe Date: Wed, 5 Oct 2022 15:02:54 +0100 Subject: [PATCH 2/2] chore: update README with more commands & links --- README.md | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d21bf44..f72c427 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Snyk helps you find, fix and monitor for known vulnerabilities in your dependencies, both on an ad hoc basis and as part of your CI (Build) system. ## Snyk snyk-licenses-texts -Snyk Licenses Report that provides Organization level licenses used, copyrights & dependencies data (including license texts & their urls). +Snyk Licenses Text report that provides Organization level licenses used, copyrights & dependencies data (including license texts & their urls). Optionally the results can be filtered for a specific projects. + +The tool is a wrapper around [Snyk APIs](https://snyk.docs.apiary.io/) so users must have API access (including Reporting, Licenses & Dependencies APIs) # Installation Download the latest binary from the [releases](https://github.com/snyk-tech-services/snyk-licenses-texts/releases) page @@ -19,21 +21,27 @@ Ensure `SNYK_TOKEN` is set and has access to the Organization you want to genera ### Basic CLI commands - `help` - show help & all available commands and their options -- `json` - generate the raw JSON licenses & dependencies data -- `generate` - generates an HTML report of licenses & dependencies data +- `json` - generate the raw JSON licenses & dependencies data for a Snyk Organization (can filter for a specific Snyk project) +- `generate` - generates an HTML report of licenses & dependencies data for a Snyk Organization (can filter for a specific Snyk project) ### Supported Options +``` +Commands: + snyk-licenses-text generate Generate org licenses & dependencies report in HTML format + [aliases: g] + snyk-licenses-text json Generate org licenses & dependencies data in JSON format + [aliases: j] + +``` Example usage: -- See help: - `snyk-licenses-report help` -- Get JSON output only: - `snyk-licenses-report json --orgPublicId=` -- Default HTML report (Licenses per Org view): - `snyk-licenses-report generate --orgPublicId=` -- See more information on what is hapenning behind the scenes: - `DEBUG=snyk-license* snyk-licenses-report generate --orgPublicId=` +- See help: `snyk-licenses-text --help` +- See help and available options for a specific command: `snyk-licenses-text --help generate` +- Get JSON output only: `snyk-licenses-text json --orgPublicId=` +- Default HTML report (Licenses per Org view): `snyk-licenses-text generate --orgPublicId=` +- Default HTML report (Licenses per Org view) filtered for a specific project: `snyk-licenses-text generate --orgPublicId= --project=` +- See more information on what is happening behind the scenes: `DEBUG=snyk-license* snyk-licenses-text generate --orgPublicId=` - Custom Handlebars.js template provided: - `snyk-licenses-report generate --orgPublicId= --template="PATH/TO/TEMPLATE/template.hsb"` + `snyk-licenses-text generate --orgPublicId= --template="PATH/TO/TEMPLATE/template.hsb"` The data in the template is available is in the format: ``` {