Skip to content

Commit

Permalink
Merge pull request #191 from snyk/chore/fix-broken-tests-and-bump-nod…
Browse files Browse the repository at this point in the history
…e-to-16

chore: fix broken tests and bump node to 16
  • Loading branch information
xzhou-snyk authored Oct 20, 2022
2 parents 60e23db + 9aa61ba commit 7938b02
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 77 deletions.
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

defaults: &defaults
docker:
- image: node:10
- image: node:16
working_directory: ~/snyk-python-plugin

commands:
Expand Down Expand Up @@ -52,7 +52,6 @@ commands:
python -m pip install --user --quiet -r dev-requirements.txt --disable-pip-version-check
# pipenv installation always bumps pip version to >18.0.0, we manually install the desired pip version again
python -m pip install --user --quiet pip==$PIP_VER
export PATH=$HOME/.pyenv/shims:$PATH
pyenv rehash
npm run test
environment:
Expand Down Expand Up @@ -114,7 +113,7 @@ jobs:
release:
<<: *defaults
docker:
- image: node:10
- image: node:16
steps:
- checkout_and_merge
- run:
Expand Down Expand Up @@ -160,7 +159,7 @@ workflows:
- Build
matrix:
parameters:
node_version: ['10','12', '14']
node_version: ['12','14', '16']
pip_version: ['10.0.0','18.1.0']
python_version: ['2.7','3.6', '3.7', '3.8', '3.9']
filters:
Expand Down
7 changes: 3 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint",
"prettier"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": 0,
Expand All @@ -24,6 +23,6 @@
"no-var": 2,
"prefer-arrow-callback": 2,
"prefer-const": 2,
"require-atomic-updates": 0,
},
"require-atomic-updates": 0
}
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
16.16.0
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Snyk helps you find, fix and monitor for known vulnerabilities in your dependenc

## Supported Node versions

| Node | Supported |
|-------|------------|
| 10 ||
| 12 ||
| 14 ||
| Node | Supported |
|------|------------|
| 12 ||
| 14 ||
| 16 ||

## Supported Pip & Python versions (requirements.txt)

Expand Down
6 changes: 4 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pipenv
virtualenv
pipenv==2022.4.8; python_version >= '3.6'
pipenv==2018.11.26; python_version == '2.7'
virtualenv==20.15.1; python_version >= '3.6'
virtualenv==16.2.0; python_version == '2.7'
mock
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
coverageDirectory: '<rootDir>/reports/coverage',
testMatch: ['**/*.spec.ts'], // Remove when all tests are using Jest
modulePathIgnorePatterns: ['<rootDir>/dist', '<rootDir/reports>'],
setupFilesAfterEnv: ['<rootDir>/test/matchers/setup.ts'],
reporters: [
'default',
[
Expand Down
5 changes: 2 additions & 3 deletions lib/dependencies/inspect-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ function dumpAllFilesInTempDir(tempDirName: string) {
throw new Error('The file `' + currentReadFilePath + '` is missing');
}

const relFilePathToDumpDir = getFilePathRelativeToDumpDir(
currentReadFilePath
);
const relFilePathToDumpDir =
getFilePathRelativeToDumpDir(currentReadFilePath);

const writeFilePath = path.join(tempDirName, relFilePathToDumpDir);

Expand Down
2 changes: 1 addition & 1 deletion lib/dependencies/sub-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function execute(
export function executeSync(
command: string,
args: string[],
options?: SpawnOptions
options?: ProcessOptions
) {
const spawnOptions = makeSpawnOptions(options);

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
},
"devDependencies": {
"@snyk/types-tap": "^1.1.0",
"@types/jest": "^24.9.0",
"@types/node": "^14.14.31",
"@types/jest": "^28.1.3",
"@types/node": "^16.11.66",
"@types/tmp": "^0.1.0",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"cross-env": "^5.2.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"jest": "^25.5.4",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"jest": "^28.1.3",
"jest-diff": "^25.5.0",
"jest-junit": "^10.0.0",
"prettier": "^1.19.1",
"prettier": "^2.7.1",
"sinon": "^2.3.2",
"tap": "^12.6.1",
"ts-jest": "^25.5.1",
"ts-jest": "^28.0.8",
"ts-node": "^8.10.2",
"typescript": "^3.9.7"
"typescript": "^4.8.4"
}
}
36 changes: 0 additions & 36 deletions test/matchers/dep-graph.ts

This file was deleted.

5 changes: 0 additions & 5 deletions test/matchers/setup.ts

This file was deleted.

7 changes: 3 additions & 4 deletions test/system/inspect.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
EmptyManifestError,
inspect,
PythonPluginErrorNames,
RequiredPackagesMissingError,
} from '../../lib';
import { chdirWorkspaces } from '../test-utils';
Expand Down Expand Up @@ -48,7 +47,7 @@ describe('inspect', () => {
.connectDep('jinja2', 'markupsafe')
.build();

expect(result.dependencyGraph).toEqualDepGraph(expected);
expect(result.dependencyGraph.equals(expected)).toBeTruthy();
});
});

Expand Down Expand Up @@ -142,7 +141,7 @@ describe('inspect', () => {
const expectedDepGraphData = require(expectedDepGraphPath);
const expectedDepGraph = depGraphLib.createFromJSON(expectedDepGraphData);

expect(result.dependencyGraph).toEqualDepGraph(expectedDepGraph);
expect(result.dependencyGraph.equals(expectedDepGraph)).toBeTruthy();
});

it('projectName option should set the dep graph root node name', async () => {
Expand All @@ -157,7 +156,7 @@ describe('inspect', () => {
);
const expectedDepGraph = depGraphLib.createFromJSON(expectedDepGraphData);

expect(result.dependencyGraph).toEqualDepGraph(expectedDepGraph);
expect(result.dependencyGraph.equals(expectedDepGraph)).toBeTruthy();
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# the gevent package has 'psutil' twice as a dependency (probably with different requirements)
gevent==21.1.2
gevent==21.8.0

0 comments on commit 7938b02

Please sign in to comment.