Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
No commit message
  • Loading branch information
enriquezrene committed Apr 12, 2020
commit 1e5bc3e1ec96a4d6c3f8bd84765eac1fdfba50f4
13 changes: 4 additions & 9 deletions .github/workflows/CD-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@ jobs:
BASE_PATH: "src/environments/"
run: |
import os
import json
data = {}
base_path = os.environ.get('BASE_PATH', 'src/environments/')
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
data = json.load(jsonFileRead)
data["scopes"] = str(os.environ['SCOPES']).split(",")
data["client_id"] = os.environ['CLIENT_ID']
data["authority"] = os.environ['AUTHORITY']
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
json.dump(data, jsonFileWrite)
with open(base_path + "keys.ts", "w") as fileWithKeys:
fileWithKeys.write('export const AUTHORITY = ') + str(os.environ['SCOPES']).split(",") + ';';
fileWithKeys.write('\nexport const CLIENT_ID = ' + os.environ['CLIENT_ID']) + ';';
fileWithKeys.write('\nexport const SCOPES = ' + os.environ['AUTHORITY']) + ';';

- name: 'run: npm install and build'
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/CI-mutation-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Running mutation tests

on:
schedule:
- cron: '* 13 * * 1'
branches:
- master

jobs:
configuring-stryker:
name: Running stryker
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Clone and checkout branch
uses: actions/checkout@master

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Install dependencies
run: npm install

- name: Inject Secrets
env:
SCOPES: ${{ secrets.scopes }}
CLIENT_ID: ${{ secrets.client_id }}
AUTHORITY: ${{ secrets.authority }}
run: sudo sh scripts/populate-keys.sh

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

- name: Installing stryker-cli
run: npm install -g stryker-cli

- name: Running stryker
run: stryker run
16 changes: 7 additions & 9 deletions .github/workflows/CI-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ jobs:
BASE_PATH: "src/environments/"
run: |
import os
import json
data = {}
base_path = os.environ.get('BASE_PATH', 'src/environments/')
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
data = json.load(jsonFileRead)
data["scopes"] = str(os.environ['SCOPES']).split(",")
data["client_id"] = os.environ['CLIENT_ID']
data["authority"] = os.environ['AUTHORITY']
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
json.dump(data, jsonFileWrite)
with open(base_path + "keys.ts", "w") as fileWithKeys:
scopes = str(os.environ['SCOPES']).split(",")
client_id = os.environ['CLIENT_ID']
authority = os.environ['AUTHORITY']
fileWithKeys.write(f'export const SCOPES = {scopes};')
fileWithKeys.write(f'\nexport const CLIENT_ID = {client_id};')
fileWithKeys.write(f'\nexport const AUTHORITY = {authority};')

- name: Run the test
run: npm run ci-test --if-present
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ yarn-error.log
testem.log
/typings
.keys.json
**keys.ts
src/environments/keys.ts

# System Files
.DS_Store
Thumbs.db

# stryker temp files
.stryker-tmp
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ Run `ng build` to build the project. The build artifacts will be stored in the `

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

## Running mutation tests
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:
```
npm install -g stryker-cli
```

Now, run stryker:
```
stryker run
```

Stryker is also executed on GitHub actions with the following cron expresion:


## Running end-to-end tests

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