From 94765900b633b73525274a15049aa1da7c5cbff0 Mon Sep 17 00:00:00 2001 From: Exulansis Date: Sat, 21 Sep 2019 21:00:21 +0200 Subject: [PATCH 1/3] chore(ci): fix build script, updated github actions to use yarn, set env variables --- .github/workflows/nodejs.yml | 12 +++++++----- .gitignore | 1 + tsconfig.json | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b15baf3..eccdcca 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [8.x, 10.x, 12.x] + node-version: [10.x] steps: - uses: actions/checkout@v1 @@ -17,10 +17,12 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: npm install, build, and test + - name: yarn install, build and test run: | - npm install - npm run build --if-present - npm test + yarn install + yarn build + yarn test env: CI: true + BLOCK_TIME: 1 + REQUESTS: 500 diff --git a/.gitignore b/.gitignore index f3c728e..d701ab8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .idea yarn-error.log +js diff --git a/tsconfig.json b/tsconfig.json index 9994981..82102b6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "!./node_modules/**/*.ts" ], "exclude": [ - "./js" + "./js", + "./tests" ] } From b1c0993787ff0be7e33716e850002c136c5ff088 Mon Sep 17 00:00:00 2001 From: Exulansis Date: Sat, 21 Sep 2019 21:10:46 +0200 Subject: [PATCH 2/3] chore: removed console.log from test --- tests/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/index.ts b/tests/index.ts index 14d7869..0448cc4 100644 --- a/tests/index.ts +++ b/tests/index.ts @@ -83,7 +83,7 @@ describe("Fueling service integration tests", () => { }); const pings = new Array(nrOfRequests).fill(0).map(ping) - return Promise.all(pings).then(testFuelingService.getAllBalances).then(console.log) + return Promise.all(pings) }) }) From b8eed46b2993ff7bd740f20afbff0e03ff93ee02 Mon Sep 17 00:00:00 2001 From: Exulansis Date: Sat, 21 Sep 2019 21:25:21 +0200 Subject: [PATCH 3/3] fix(ci): correctly exit after mocha tests are done. Lowered CI params for block time and requests --- .github/workflows/nodejs.yml | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index eccdcca..9a96415 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -24,5 +24,5 @@ jobs: yarn test env: CI: true - BLOCK_TIME: 1 - REQUESTS: 500 + BLOCK_TIME: 0.5 + REQUESTS: 320 diff --git a/package.json b/package.json index 5b1f2f2..a14f054 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node ./ts/server.ts", "build": "rm -rf ./js; tsc -p ./tsconfig.json", - "test": "mocha --opts ./mocha.opts ./tests/index.ts" + "test": "mocha --opts ./mocha.opts ./tests/index.ts --exit" }, "husky": { "hooks": {