Skip to content

Commit bf65e5f

Browse files
authored
Merge pull request #105 from ioet/58-stryker2
Enabling straker
2 parents 43526f6 + 6009bc8 commit bf65e5f

File tree

13 files changed

+1911
-36
lines changed

13 files changed

+1911
-36
lines changed

.github/workflows/CD-time-tracker-ui.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,11 @@ jobs:
2525
node-version: '12.x'
2626

2727
- name: Inject Secrets
28-
shell: python
2928
env:
3029
SCOPES: ${{ secrets.scopes }}
3130
CLIENT_ID: ${{ secrets.client_id }}
3231
AUTHORITY: ${{ secrets.authority }}
33-
BASE_PATH: "src/environments/"
34-
run: |
35-
import os
36-
import json
37-
data = {}
38-
base_path = os.environ.get('BASE_PATH', 'src/environments/')
39-
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
40-
data = json.load(jsonFileRead)
41-
data["scopes"] = str(os.environ['SCOPES']).split(",")
42-
data["client_id"] = os.environ['CLIENT_ID']
43-
data["authority"] = os.environ['AUTHORITY']
44-
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
45-
json.dump(data, jsonFileWrite)
32+
run: sudo sh scripts/populate-keys.sh
4633

4734
- name: 'run: npm install and build'
4835
run: |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Running mutation tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
branches:
7+
- stryker
8+
9+
jobs:
10+
configuring-stryker:
11+
name: Running stryker
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 360
14+
steps:
15+
- name: Clone and checkout branch
16+
uses: actions/checkout@master
17+
18+
- name: Set up Node.js version
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: '12.x'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Inject Secrets
27+
env:
28+
SCOPES: ${{ secrets.scopes }}
29+
CLIENT_ID: ${{ secrets.client_id }}
30+
AUTHORITY: ${{ secrets.authority }}
31+
run: sudo sh scripts/populate-keys.sh
32+
33+
- name: Run the test
34+
run: npm run ci-test --if-present
35+
36+
- name: Installing stryker-cli
37+
run: npm install -g stryker-cli
38+
39+
- name: Running stryker
40+
run: stryker run

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,11 @@ jobs:
4040
run: npm install
4141

4242
- name: Inject Secrets
43-
shell: python
4443
env:
4544
SCOPES: ${{ secrets.scopes }}
4645
CLIENT_ID: ${{ secrets.client_id }}
4746
AUTHORITY: ${{ secrets.authority }}
48-
BASE_PATH: "src/environments/"
49-
run: |
50-
import os
51-
import json
52-
data = {}
53-
base_path = os.environ.get('BASE_PATH', 'src/environments/')
54-
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
55-
data = json.load(jsonFileRead)
56-
data["scopes"] = str(os.environ['SCOPES']).split(",")
57-
data["client_id"] = os.environ['CLIENT_ID']
58-
data["authority"] = os.environ['AUTHORITY']
59-
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
60-
json.dump(data, jsonFileWrite)
47+
run: sudo sh scripts/populate-keys.sh
6148

6249
- name: Run the test
6350
run: npm run ci-test --if-present

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ yarn-error.log
4141
testem.log
4242
/typings
4343
.keys.json
44+
**keys.ts
45+
src/environments/keys.ts
46+
4447
# System Files
4548
.DS_Store
4649
Thumbs.db
50+
51+
# stryker temp files
52+
.stryker-tmp

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ Run `ng build` to build the project. The build artifacts will be stored in the `
5656

5757
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
5858

59+
## Running mutation tests
60+
Mutation tests have been enabled using stryker. You can run those tests locally, it takes ~4 hours to have the results. If you want to run them locally please install stryker locally:
61+
```
62+
npm install -g stryker-cli
63+
```
64+
65+
Now, run stryker:
66+
```
67+
stryker run
68+
```
69+
70+
Stryker is also executed on GitHub actions with the following cron expresion:
71+
72+
5973
## Running end-to-end tests
6074

6175
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

0 commit comments

Comments
 (0)