Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up integration tests #216

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
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
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,39 @@ jobs:
command: |
npm run test:unit

tests_integration:
working_directory: ~/app
docker:
- image: circleci/node:10.13.0
environment:
NODE_ENV: production
- image: browserless/chrome:1.9.0-puppeteer-1.15.0
environment:
MAX_CONCURRENT_SESSIONS: 10
steps:
- attach_workspace:
at: ~/app
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Serve the build
background: true
command: |
echo 0.0.0.0 app | sudo tee -a /etc/hosts
echo 127.0.0.1 app | sudo tee -a /etc/hosts
npm run serve:integration
- run:
name: Wait for server (Using curl to really wait)
command: |
printenv
dockerize -wait tcp://127.0.0.1:8080 -timeout 1m
curl http://app:8080
- run:
name: Run tests
command: |
echo 127.0.0.1 chrome | sudo tee -a /etc/hosts
npm run test:integration

misc:
working_directory: ~/app
docker:
Expand All @@ -54,6 +87,9 @@ workflows:
- tests_unit:
requires:
- build
- tests_integration:
requires:
- build
- misc:
requires:
- build
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
public
dist
docs
16 changes: 15 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
module.exports = {
presets: [
'@vue/app'
]
],
env: {
test: {
presets: [
['@vue/app', {
useBuiltIns: 'entry',
modules: 'commonjs'
}]
],
plugins: [
'transform-es2015-modules-commonjs',
'dynamic-import-node'
]
}
}
}
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ services:
- ./:/app
ports:
- 8080:8080

chrome:
image: browserless/chrome:1.9.0-puppeteer-1.15.0
environment:
- MAX_CONCURRENT_SESSIONS=10
ports:
- '3000:3000'
links:
- app
Loading