-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat:SP-1918 Use scanoss-py policies * feat: SP-1919 Add skip snippet and scanoss setting flags * chore: SP-1920 Use scanoss-py copyleft policy * chore: SP-1922 Integrates undeclared components policy from scanoss-py * chore: SP-1924 Adds copyleft policy unit tests * chore: SP-1927 Adds undeclared component unit tests * chore: SP-1964 Removes sbom.json feature * chore: SP-1957 Upgrades scanoss.py version to v1.18.1 * chore: Fixes linter warnings * chore: SP-1979 Removes sbom.json export format * chore: SP-1980 Add warning when SCANOSS settings is not enabled * chore: SP-1977 Adds breaking change documentation v1.0.1 * chore: SP-1978 Upgrades default runtime container version to v1.19.0
- Loading branch information
1 parent
15a506c
commit 010b9a3
Showing
27 changed files
with
1,657 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ lib/ | |
dist/ | ||
node_modules/ | ||
coverage/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import { CopyLeftArgumentBuilder } from '../src/policies/argument_builders/copyleft-argument-builder'; | ||
import { RUNTIME_CONTAINER } from '../src/app.input'; | ||
|
||
jest.mock('../src/app.input', () => ({ | ||
...jest.requireActual('../src/app.input'), | ||
REPO_DIR: 'scanoss', | ||
OUTPUT_FILEPATH: 'results.json', | ||
COPYLEFT_LICENSE_EXCLUDE: '', | ||
COPYLEFT_LICENSE_EXPLICIT: '', | ||
COPYLEFT_LICENSE_INCLUDE: '' | ||
})); | ||
describe('CopyleftArgumentBuilder', () => { | ||
// Store the module for direct manipulation | ||
const appInput = jest.requireMock('../src/app.input'); | ||
|
||
afterEach(() => { | ||
appInput.COPYLEFT_LICENSE_EXPLICIT = ''; | ||
appInput.COPYLEFT_LICENSE_EXCLUDE = ''; | ||
appInput.COPYLEFT_LICENSE_INCLUDE = ''; | ||
}); | ||
|
||
it('Copyleft explicit test', async () => { | ||
appInput.COPYLEFT_LICENSE_EXPLICIT = 'MIT,Apache-2.0'; | ||
appInput.COPYLEFT_LICENSE_EXCLUDE = 'MIT,Apache-2.0'; | ||
const builder = new CopyLeftArgumentBuilder(); | ||
const cmd = await builder.build(); | ||
expect(cmd).toEqual([ | ||
'run', | ||
'-v', | ||
'scanoss:/scanoss', | ||
RUNTIME_CONTAINER, | ||
'inspect', | ||
'copyleft', | ||
'--input', | ||
'results.json', | ||
'--format', | ||
'md', | ||
'--explicit', | ||
'MIT,Apache-2.0' | ||
]); | ||
}); | ||
|
||
it('Copyleft exclude test', async () => { | ||
appInput.COPYLEFT_LICENSE_EXCLUDE = 'MIT,Apache-2.0'; | ||
const builder = new CopyLeftArgumentBuilder(); | ||
const cmd = await builder.build(); | ||
expect(cmd).toEqual([ | ||
'run', | ||
'-v', | ||
'scanoss:/scanoss', | ||
RUNTIME_CONTAINER, | ||
'inspect', | ||
'copyleft', | ||
'--input', | ||
'results.json', | ||
'--format', | ||
'md', | ||
'--exclude', | ||
'MIT,Apache-2.0' | ||
]); | ||
}); | ||
|
||
it('Copyleft include test', async () => { | ||
appInput.COPYLEFT_LICENSE_INCLUDE = 'MIT,Apache-2.0,LGPL-3.0-only'; | ||
const builder = new CopyLeftArgumentBuilder(); | ||
const cmd = await builder.build(); | ||
expect(cmd).toEqual([ | ||
'run', | ||
'-v', | ||
'scanoss:/scanoss', | ||
RUNTIME_CONTAINER, | ||
'inspect', | ||
'copyleft', | ||
'--input', | ||
'results.json', | ||
'--format', | ||
'md', | ||
'--include', | ||
'MIT,Apache-2.0,LGPL-3.0-only' | ||
]); | ||
}); | ||
|
||
it('Copyleft empty parameters test', async () => { | ||
const builder = new CopyLeftArgumentBuilder(); | ||
const cmd = await builder.build(); | ||
expect(cmd).toEqual([ | ||
'run', | ||
'-v', | ||
'scanoss:/scanoss', | ||
RUNTIME_CONTAINER, | ||
'inspect', | ||
'copyleft', | ||
'--input', | ||
'results.json', | ||
'--format', | ||
'md' | ||
]); | ||
}); | ||
|
||
it('Build Command test', async () => { | ||
const builder = new CopyLeftArgumentBuilder(); | ||
const cmd = await builder.build(); | ||
expect(cmd).toEqual([ | ||
'run', | ||
'-v', | ||
'scanoss:/scanoss', | ||
RUNTIME_CONTAINER, | ||
'inspect', | ||
'copyleft', | ||
'--input', | ||
'results.json', | ||
'--format', | ||
'md' | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.