Skip to content

Commit

Permalink
Add CI job for launchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszantas committed Apr 19, 2022
1 parent 30243ba commit d076a01
Show file tree
Hide file tree
Showing 15 changed files with 465 additions and 70 deletions.
54 changes: 49 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,37 @@ commands:
- store_artifacts:
path: integration_tests/temp/reports

launchpad-ci:
description: Run Launchpad-such-wow tests
steps:
- run:
name: node -v
command: node -v
- run:
name: npm -v
command: npm -v
- run:
name: npm install
command: cd applications/launchpad_v2 && npm install
- run:
name: lint
command: |
cd applications/launchpad_v2
npm run lint:test
when: always
- run:
name: test
command: |
cd applications/launchpad_v2
npm run test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: applications/launchpad_v2/temp/reports/junit
- store_test_results:
path: applications/launchpad_v2/temp/reports
- store_artifacts:
path: applications/launchpad_v2/temp/reports
destination: launchpad_reports

jobs:
run-integration-tests:
docker:
Expand All @@ -122,6 +153,15 @@ jobs:
- checkout
- cucumber-js-ffi

run-launchpad-tests:
docker:
- image: *rust_image
environment:
CARGO_HTTP_MULTIPLEXING: false
steps:
- checkout
- launchpad-ci

workflows:
version: 2
workflow:
Expand All @@ -130,12 +170,16 @@ workflows:
filters:
branches:
ignore:
gh-pages
launchpad_such_wow # TODO: Remove this filter once the branch is merged into development
- gh-pages
- /launchpad.*/ # TODO: Remove this filter once the branch is merged into development
- run-ffi-integration-tests:
filters:
branches:
ignore:
gh-pages
launchpad_such_wow # TODO: Remove this filter once the branch is merged into development

- gh-pages
- /launchpad.*/ # TODO: Remove this filter once the branch is merged into development
- run-launchpad-tests:
filters:
branches:
only:
- /launchpad.*/
2 changes: 2 additions & 0 deletions applications/launchpad_v2/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
.jest

# production
/build
Expand All @@ -17,6 +18,7 @@
.env.development.local
.env.test.local
.env.production.local
temp

npm-debug.log*
yarn-debug.log*
Expand Down
21 changes: 20 additions & 1 deletion applications/launchpad_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The Tari Launchpad is dedicated for beginners in Blockchain world, as well as fo
$ npm install

# Run the application
$ npm run tauri dev
$ npm run dev
```

### Other scripts
Expand All @@ -38,6 +38,21 @@ $ npm run lint

# With auto-fix
$ npm run lint:fix

# Run Lint test - it produces report in temp/reports folder
$ npm run lint:test
```

#### Tests

```bash
$ npm run test
```

#### Build

```bash
$ npm run bundle
```

## Development notes
Expand Down Expand Up @@ -65,3 +80,7 @@ Recommendations:
- `styles` - Design system
- `types` - (?) not sure if we need this. It should contain common types used across the application. we keep it for now and remove at the end if not needed.
- `utils` - helpers etc.

### CI with CircleCI

The CircleCI runs tests and eslint check for branches that name starts with `launchpad`.
1 change: 1 addition & 0 deletions applications/launchpad_v2/__tests__/mocks/mockImages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {}
1 change: 1 addition & 0 deletions applications/launchpad_v2/__tests__/mocks/mockStyles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {}
Empty file.
26 changes: 26 additions & 0 deletions applications/launchpad_v2/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
globals: {
'ts-jest': {
isolatedModules: true,
},
},
transform: {
'^.+\\.(ts|tsx|js|jsx)$': 'ts-jest',
},
testPathIgnorePatterns: ['node_modules/', '__tests__/mocks/'],
transformIgnorePatterns: ['node_modules/(?!@tauri)'],
cacheDirectory: '.jest/cache',
moduleNameMapper: {
'\\.(svg|png|jpg)$': '<rootDir>/__tests__/mocks/mockImages.js',
'\\.(css|scss)$': '<rootDir>/__tests__/mocks/mockStyles.js',
},
setupFilesAfterEnv: [
'<rootDir>/src/setupTests.ts'
],
collectCoverage: true,
reporters: ['jest-junit'],
coverageDirectory: 'temp/reports/tests',
}
Loading

0 comments on commit d076a01

Please sign in to comment.