Skip to content

Commit

Permalink
Add E2E tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
idolgov committed Oct 1, 2023
1 parent 4767350 commit a0bf943
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/start-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash

set -eu

exec > >(awk '{ print strftime("\033[0;36mYLITSE-API:\033[0m"), $0 }') 2>&1

cd ylitse-api
source env/bin/activate
YLITSE_POSTGRES_DATA= make run-gunicorn
27 changes: 25 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,34 @@ jobs:
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
node-version: '16.x'
cache: npm
- name: Install deps
run: npm ci
- name: Lint
run: npm run lint
- name: Run unit tests
run: npm run test:unit
- name: Clone the back end
run: git clone https://gitlab.com/ylitse/ylitse-api
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
cache-dependency-path: ylitse-api/requirements.txt
- name: Set up the back end
run: make env && . env/bin/activate && make conf
working-directory: ylitse-api
env:
YLITSE_POSTGRES_URL: ${{ secrets.YLITSE_POSTGRES_URL }}
- name: Run E2E tests
uses: cypress-io/github-action@v6
with:
config: baseUrl=http://localhost:8082
start: |
${{ github.workspace }}/.github/scripts/start-api
npm run start
wait-on: 'http://localhost:8080/version, http://localhost:8082'
env:
DEBUG: '@cypress/github-action'
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"react-test-renderer": "^18.2.0",
"ts-loader": "^8.4.0",
"typescript": "^4.7.4",
"webpack": "^5.73.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
},
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const DEV_API = process.env.DEV_API

module.exports = {
devServer: {
port: 8082,
historyApiFallback: {
verbose: true,
},
Expand Down

0 comments on commit a0bf943

Please sign in to comment.