Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(2683): nodejs upgrade #35

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ npm-debug.log
.DS_STORE
.*.swp
.nyc_output/
package-lock.json
32 changes: 14 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "screwdriver-executor-router",
"version": "2.0.0",
"version": "3.0.0",
"description": "A generic plugin for routing builds to specified executors",
"main": "index.js",
"scripts": {
"pretest": "eslint . --quiet",
"test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true"
},
"repository": {
"type": "git",
"url": "git@github.com:screwdriver-cd/executor-router.git"
"url": "git+https://github.com/screwdriver-cd/executor-router.git"
},
"homepage": "https://github.com/screwdriver-cd/executor-router",
"bugs": "https://github.com/screwdriver-cd/screwdriver/issues",
Expand All @@ -32,25 +31,22 @@
"Tiffany Kyi <[email protected]>"
],
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^6.8.0",
"eslint-config-screwdriver": "^5.0.3",
"mocha": "^8.2.1",
"chai": "^4.3.7",
"eslint": "^8.28.0",
"eslint-config-screwdriver": "^7.0.0",
"mocha": "^10.1.0",
"mocha-multi-reporters": "^1.5.1",
"mocha-sonarqube-reporter": "^1.0.2",
"mockery": "^2.0.0",
"nyc": "^15.0.0",
"sinon": "^4.5.0"
"mockery": "^2.1.0",
"nyc": "^15.1.0",
"sinon": "^15.0.0"
},
"dependencies": {
"screwdriver-data-schema": "^21.0.0",
"screwdriver-executor-base": "^8.3.0",
"screwdriver-logger": "^1.0.0"
"screwdriver-data-schema": "^22.0.1",
"screwdriver-executor-base": "^9.0.0",
"screwdriver-logger": "^2.0.0"
},
"release": {
"debug": false,
"verifyConditions": {
"path": "./node_modules/semantic-release/src/lib/plugin-noop.js"
}
"debug": false
}
}
2 changes: 1 addition & 1 deletion screwdriver.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
shared:
image: node:12
image: node:18

jobs:
main:
Expand Down
16 changes: 15 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ describe('index test', () => {
});

describe('_stop', () => {
const apiUri = 'https://api.sd.cd';

it('default executor when no annotation is given', () => {
executor = new Executor({
defaultPlugin: 'example',
Expand All @@ -429,6 +431,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
buildId: 920
})
.then(result => {
Expand All @@ -441,6 +444,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
buildId: 920
})
.then(result => {
Expand All @@ -456,6 +460,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
annotations: {
'beta.screwdriver.cd/executor': 'darrenIsSometimesRight'
},
Expand All @@ -468,12 +473,13 @@ describe('index test', () => {
});
});

it('uses an annotation to determine which executor to call', () => {
it('uses an annotation to determine which executorn to call', () => {
klu909 marked this conversation as resolved.
Show resolved Hide resolved
k8sExecutorMock._stop.rejects();
exampleExecutorMock._stop.resolves('exampleExecutorResult');

return executor
.stop({
apiUri,
annotations: {
'beta.screwdriver.cd/executor': 'example'
},
Expand All @@ -493,6 +499,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
annotations: {
'beta.screwdriver.cd/executor': 'k8s'
},
Expand Down Expand Up @@ -615,6 +622,8 @@ describe('index test', () => {
});

describe('Executor config with weightage', () => {
const apiUri = 'https://api.sd.cd';

beforeEach(() => {
executor = new Executor({
ecosystem,
Expand Down Expand Up @@ -671,6 +680,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
buildId: 920
})
.then(result => {
Expand Down Expand Up @@ -714,6 +724,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
buildId: 920
})
.then(() => {
Expand Down Expand Up @@ -770,6 +781,7 @@ describe('index test', () => {

return executor
._stop({
apiUri,
buildId: 920
})
.then(result => {
Expand All @@ -787,6 +799,7 @@ describe('index test', () => {

return executor
.stop({
apiUri,
annotations: {
'beta.screwdriver.cd/executor': 'k8s-vm'
},
Expand Down Expand Up @@ -823,6 +836,7 @@ describe('index test', () => {

return executor
._stop({
apiUri,
buildId: 920
})
.then(result => {
Expand Down