From 2e95e9a851cf00bedf3c9fb0afbc8dda0c8bdd9a Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Tue, 11 Oct 2022 22:00:28 +1100 Subject: [PATCH 1/3] Github actions version updates --- .github/workflows/build.yml | 6 +++--- .github/workflows/coverage.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf10c02..2daf53a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,9 @@ jobs: node-version: [ 14.x, 16.x, 17.x ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -33,7 +33,7 @@ jobs: - name: Upload Artifact if: ${{ matrix.os == 'ubuntu-20.04' && matrix.node-version == '16.x' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: qtest-mstest-parser path: | diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fc1a2b2..c780462 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,12 +22,12 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Set Up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -40,7 +40,7 @@ jobs: run: nyc --reporter=lcov npm test - name: Upload Coverage To Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec7d043..fe07c77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,9 +19,9 @@ jobs: node-version: [ 16.x ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install From 10cc1bf3159b8de443ddee42e9602fb9a60f2b4a Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Tue, 11 Oct 2022 22:15:20 +1100 Subject: [PATCH 2/3] Test refactoring --- tests/test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test.js b/tests/test.js index f4d046d..17923a3 100644 --- a/tests/test.js +++ b/tests/test.js @@ -4,7 +4,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 1 - Parse MSTest (TestResults-DifferentTestOutcomes.trx) results file with different test outcomes (using path with filename).'); let result = await parser.parse('./tests/sample-mstest-results/TestResults-DifferentTestOutcomes.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //All records exist comparison. assert(resultString.includes('"order": 1')); @@ -19,7 +19,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 2 - Parse MSTest (TestResults-AllPassedOutcomes.trx) results file with all passed test outcomes (using path with filename).'); let result = await parser.parse('./tests/sample-mstest-results/TestResults-AllPassedOutcomes.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //All records exist comparison. assert(resultString.includes('"order": 1')); @@ -35,7 +35,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 3 - Parse MSTest (TestResults-AllFailedOutcomes.trx) results file with all failed test outcomes (using path with filename).'); let result = await parser.parse('./tests/sample-mstest-results/TestResults-AllFailedOutcomes.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //All records exist comparison. assert(resultString.includes('"order": 1')); @@ -51,7 +51,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 4 - Parse MSTest (TestResults-WithAttachments.trx) results file with attachment details (using path with filename).'); let result = await parser.parse('./tests/sample-mstest-results/TestResults-WithAttachments.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //All records exist comparison. assert(resultString.includes('"order": 1')); @@ -65,7 +65,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 5 - Parse all MSTest (.trx) result files (using path to result files - path ending /).'); let result = await parser.parse('./tests/sample-mstest-results/', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //Record start comparison. assert(resultString.includes('"order": 1')); @@ -78,7 +78,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 6 - Parse all MSTest (.trx) result files (using path to result files - path not ending /).'); let result = await parser.parse('./tests/sample-mstest-results', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //Record start comparison. assert(resultString.includes('"order": 1')); @@ -91,7 +91,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 7 - Parse all MSTest (.trx) result files (using matching pattern - *.trx /).'); let result = await parser.parse('./tests/sample-mstest-results/*.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //Record start comparison. assert(resultString.includes('"order": 1')); @@ -104,7 +104,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 8 - Parse all MSTest (.trx) result files (using matching pattern - **/*.trx /).'); let result = await parser.parse('./tests/sample-mstest-results/**/*.trx', null); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //Record start comparison. assert(resultString.includes('"order": 1')); @@ -152,7 +152,7 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 11 - Delay test.'); - var waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000); + let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000); let timeNow = new Date().getTime(); parser.delay(waitTime); let timeAfter = new Date().getTime(); @@ -170,9 +170,9 @@ const parser = require('../parser.js'); (async () => { console.log('TEST 13 - Parse MSTest (TestResults-DifferentTestOutcomes.trx) results file with different test outcomes (using path with filename) & delay option.'); - var waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000); + let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000); let result = await parser.parse('./tests/sample-mstest-results/TestResults-DifferentTestOutcomes.trx', { delay: waitTime }); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //All records exist comparison. assert(resultString.includes('"order": 1')); @@ -188,7 +188,7 @@ const parser = require('../parser.js'); console.log('TEST 14 - Parse all MSTest (.trx) result files (using path to result files - path ending /) & delay option.'); let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000); let result = await parser.parse('./tests/sample-mstest-results/', { delay: waitTime }); - var resultString = JSON.stringify(result, null, 4); + let resultString = JSON.stringify(result, null, 4); //console.log(resultString); //Record start comparison. assert(resultString.includes('"order": 1')); From d0c0a7486aed00eda581bd9d88af513828920581 Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Tue, 11 Oct 2022 22:17:37 +1100 Subject: [PATCH 3/3] build.yml - Node version 18.x addition --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2daf53a..2db2628 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ ubuntu-20.04, windows-2022, macos-11 ] - node-version: [ 14.x, 16.x, 17.x ] + node-version: [ 14.x, 16.x, 17.x, 18.x ] steps: - uses: actions/checkout@v3