Skip to content

Commit 899536c

Browse files
committed
wip: testing console handler in junit reports
1 parent 23d5b65 commit 899536c

File tree

7 files changed

+24
-42
lines changed

7 files changed

+24
-42
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ build:build-generate:
152152
rules:
153153
# Runs on staging commits and ignores version commits
154154
- if: $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
155-
# Manually run on commits other than master and staging and ignore version commits
156-
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(?:master|staging)$/ && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
157-
when: manual
155+
# Runs on tag pipeline where the tag is a prerelease or release version
156+
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
158157

159158
build:platforms:
160159
stage: build
@@ -170,9 +169,8 @@ build:platforms:
170169
rules:
171170
# Runs on staging commits and ignores version commits
172171
- if: $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
173-
# Manually run on commits other than master and staging and ignore version commits
174-
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(?:master|staging)$/ && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
175-
when: manual
172+
# Runs on tag pipeline where the tag is a prerelease or release version
173+
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
176174

177175
build:prerelease:
178176
stage: build

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"eslint-plugin-import": "^2.26.0",
5252
"eslint-plugin-prettier": "^4.0.0",
5353
"jest": "^28.1.1",
54-
"jest-junit": "^13.2.0",
54+
"jest-junit": "^14.0.0",
5555
"jest-mock-process": "^1.4.0",
5656
"pkg": "5.6.0",
5757
"prettier": "^2.6.2",

scripts/build-pipelines.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ build:linux:
5757
- >
5858
nix-shell --run '
5959
npm run build --verbose;
60-
npm test -- --ci --runInBand --coverage --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL;
60+
npm test -- --ci --runInBand --coverage --verbose=false --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL;
6161
'
6262
artifacts:
6363
when: always
@@ -95,7 +95,7 @@ build:windows:
9595
- npm install --ignore-scripts
9696
- $env:Path = "$(npm bin);" + $env:Path
9797
- npm run build --verbose
98-
- npm test -- --ci --runInBand --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
98+
- npm test -- --ci --runInBand --verbose=false --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
9999
artifacts:
100100
when: always
101101
reports:
@@ -130,7 +130,7 @@ build:macos:
130130
- npm install --ignore-scripts
131131
- export PATH="$(npm bin):$PATH"
132132
- npm run build --verbose
133-
- npm test -- --ci --runInBand --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
133+
- npm test -- --ci --runInBand --verbose=false --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
134134
artifacts:
135135
when: always
136136
reports:

scripts/test-pipelines.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ check:test:
5252
- >
5353
nix-shell --run '
5454
npm run build --verbose;
55-
npm test -- --ci --runInBand --coverage --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL;
55+
npm test -- --ci --runInBand --coverage --verbose=false --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL;
5656
'
5757
artifacts:
5858
when: always

tests/bin/typescript-demo-lib.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('main', () => {
3131
});
3232
test('no input', async () => {
3333
logger.info('This test should fail');
34+
console.log('hello???');
3435
const mockLog = mockProcessStdout();
3536
await main([]);
3637
const tmpMockLog = mockLog.mock.calls.join('');
@@ -42,6 +43,7 @@ describe('main', () => {
4243
});
4344
test('adds 0 + 0', async () => {
4445
logger.info('This test should pass');
46+
console.log('hello???');
4547
const mockLog = mockProcessStdout();
4648
await main(['', '', '0', '0', dataDir]);
4749
const tmpMockLog = mockLog.mock.calls.join('');
@@ -105,4 +107,10 @@ describe('main', () => {
105107
expect(tmpMockLog).toContain('hello UTP!!');
106108
mockLog.mockRestore();
107109
});
110+
test('test logger', () => {
111+
logger.info('With logger');
112+
console.error('With console.error');
113+
console.log('With console.log');
114+
expect(3).toBe(4);
115+
})
108116
});

tests/testSequencer.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)