Skip to content

Commit

Permalink
ci: run cypress against an instance with baseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
eh-am committed Jan 3, 2022
1 parent 923fde6 commit e109bf7
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/cypress-base-url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Cypress BaseURL Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
cypress-base-url-tests:
runs-on: ubuntu-latest
container: cypress/included:8.6.0
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17.0'
- name: run nginx with /pyroscope
run: docker-compose -f cypress/base-url/base-url-docker-compose.yml up -d
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: make e2e-build
wait-on: http://localhost:8080/pyroscope
start: make server
config-file: cypress/base-url/cypress.json
env:
# keep the server quiet
PYROSCOPE_BASE_URL: 'http://localhost:8080/pyroscope'
PYROSCOPE_LOG_LEVEL: error
ENABLED_SPIES: none
CYPRESS_VIDEO: true
CYPRESS_COMPARE_SNAPSHOTS: true
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-snapshots
path: cypress/snapshots
7 changes: 7 additions & 0 deletions cypress/base-url/base-url-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'
services:
nginx:
image: nginx
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
8 changes: 8 additions & 0 deletions cypress/base-url/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"video": false,
"baseUrl": "http://localhost:8080/pyroscope/",
"integrationFolder": "cypress/integration/webapp",
"retries": {
"runMode": 5
}
}
12 changes: 12 additions & 0 deletions cypress/base-url/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
events {}
http {
server {
listen 8080;

location /pyroscope/ {
rewrite /pyroscope(.*) $1 break;
proxy_pass http://localhost:4040;
}
}
}

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"cy:webapp:ci": "cypress run --config-file webapp/cypress.json",
"cy:webapp:ss": "./scripts/cypress-screenshots.sh --config-file webapp/cypress.json",
"cy:webapp:ss-check": "CYPRESS_updateSnapshots=false ./scripts/cypress-screenshots.sh --config-file webapp/cypress.json",
"cy:webapp-base-url:open": "cypress open --config-file cypress/base-url/cypress.json",
"cy:webapp-base-url:ci": "cypress run --config-file cypress/base-url/cypress.json",
"cy:webapp-base-url:ss-check": "CYPRESS_updateSnapshots=false ./scripts/cypress-screenshots.sh --config-file cypress/base-url/cypress.json",
"cy:panel:open": "cypress open --config-file grafana-plugin/panel/cypress.json",
"cy:panel:ci": "cypress run --config-file grafana-plugin/panel/cypress.json",
"cy:panel:ss": "./scripts/cypress-screenshots.sh --config-file grafana-plugin/panel/cypress.json",
Expand Down

0 comments on commit e109bf7

Please sign in to comment.