Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
- drop old service config
- use docker for server
- clean up github actions
- setup dependabot for e2e package
  • Loading branch information
petrjasek committed Apr 8, 2024
1 parent 3d7ba0b commit c81ab26
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "e2e" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
Expand Down
29 changes: 9 additions & 20 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,32 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
node-version: ['14']
e2e: ['a', 'b']
env:
INSTALL_NODE_MODULES: true
RUN_SERVICES: true
E2E: true
TZ: Australia/Sydney
CYPRESS_SCREENSHOTS_FOLDER: /tmp/cypress
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'server/requirements.txt'
- name: Setup Environment
run: ./scripts/ci-install.sh
- name: Build Client
cache: npm
- run: |
npm install
npm build
docker compose up -d
./ci-wait-for-services.sh
working-directory: ./e2e
run: npm run build
- name: Start Services
run: ./scripts/ci-start-services.sh
- name: E2E Suite A
if: matrix.e2e == 'a'
working-directory: ./e2e
run: npm run cypress-ci -- --spec "cypress/e2e/events/*.cy.ts"
env:
CYPRESS_SCREENSHOTS_FOLDER: /tmp/cypress
- name: E2E Suite B
if: matrix.e2e == 'b'
working-directory: ./e2e
run: npm run cypress-ci -- --spec "cypress/e2e/!(events)/*.cy.ts|cypress/e2e/workqueue.cy.ts"
env:
CYPRESS_SCREENSHOTS_FOLDER: /tmp/cypress
- name: Upload screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
Expand Down
22 changes: 0 additions & 22 deletions .travis-docker-compose.yml

This file was deleted.

8 changes: 7 additions & 1 deletion e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@ version: "3.8"

services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.18
environment:
- discovery.type=single-node
networks:
- e2e
ports:
- "9200:9200"
tmpfs:
- /usr/share/elasticsearch/data

redis:
image: redis:alpine
networks:
- e2e
ports:
- "6379:6379"

mongo:
image: mongo:4
networks:
- e2e
ports:
- "27017:27017"
tmpfs:
- /data/db

Expand Down
10 changes: 5 additions & 5 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"superdesk-planning": "file:../"
},
"devDependencies": {
"@superdesk/build-tools": "^1.0.14",
"@superdesk/build-tools": "^1.0.19",
"cypress": "^12.6.0",
"cypress-real-events": "^1.7.6",
"cypress-real-events": "^1.12.0",
"cypress-terminal-report": "^5.0.2",
"extract-text-webpack-plugin": "3.0.2",
"lodash": "^4.17.15",
"moment": "^2.29.4",
"moment-timezone": "^0.5.42"
"lodash": "^4.17.21",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45"
},
"scripts": {
"cypress-ui": "cypress open",
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-start-services.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

if [ "$RUN_SERVICES" == "true" ]; then
docker compose -f .travis-docker-compose.yml up -d
docker compose -f ./e2e/docker-compose.yml up elastic redis mongo -d
while ! curl -sfo /dev/null 'http://localhost:9200/'; do echo -n '.' && sleep .5; done
fi

Expand Down
3 changes: 3 additions & 0 deletions scripts/ci-wait-for-services.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

while ! curl -sfo /dev/null 'http://localhost:9200/'; do echo -n '.' && sleep .5; done

0 comments on commit c81ab26

Please sign in to comment.