Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kelanik8 committed Dec 22, 2023
1 parent 450e26a commit 71f98eb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/assets/client/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Corteza API location
window.CortezaAPI = '//localhost:8888/api'

window.i18nPseudoModeEnabled = false
59 changes: 36 additions & 23 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,37 +100,18 @@ jobs:
working-directory: corteza/server/pkg/locale
run: make src/en

# - name: "Set up PostgreSQL database"
# env:
# POSTGRES_USER: corteza
# POSTGRES_PASSWORD: root
# POSTGRES_DB: corteza_cy_test
# run: |
# docker run -d \
# --name corteza_postgres \
# -p 5432:5432 \
# -e POSTGRES_USER=${POSTGRES_USER} \
# -e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
# -e POSTGRES_DB=${POSTGRES_DB} \
# --health-cmd="pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" \
# --health-interval=10s \
# --health-timeout=5s \
# --health-retries=5 \
# postgres:15

- name: Run server and db
working-directory: corteza
run: |
docker-compose up -d backend
docker-compose up -d postgres
- name: Update config file in webapps
- name: Update config file in ${{ matrix.client.name }} webapp
working-directory: corteza
env:
CLIENT_NAME: ${{ matrix.client.name }}
run: |
cp client/web/${CLIENT_NAME}/public/config.example.js client/web/${CLIENT_NAME}/public/config.js
sed -i -e 's/https:\/\/api.cortezaproject.your-domain.tld/\/\/localhost:8888\/api/g' client/web/${CLIENT_NAME}/public/config.js
cp .github/workflows/assets/client/config.js client/web/${CLIENT_NAME}/public/config.js
- name: Build js
working-directory: corteza/lib/js
Expand All @@ -144,7 +125,7 @@ jobs:
yarn install
yarn build
- name: Run "${{ matrix.client.name }}"
- name: Run ${{ matrix.client.name }}
working-directory: corteza
# re-link the packages for each app
env:
Expand Down Expand Up @@ -178,7 +159,7 @@ jobs:
- name: Wait for backend healthcheck
run: timeout 180s sh -c 'until docker ps | grep corteza_backend_1 | grep -q healthy; do echo "Waiting for container to be healthy..."; sleep 1; done'

- name: Run CY tests for "${{ matrix.client.name }}"
- name: Run CY tests for ${{ matrix.client.name }}
env:
CLIENT_NAME: ${{ matrix.client.name }}
CLIENT_PORT: ${{ matrix.client.port }}
Expand Down Expand Up @@ -213,3 +194,35 @@ jobs:
SCREENSHOTS_GEN_FOLDER: ${{ env.SCREENSHOTS_GEN_FOLDER }}
run: |
printf '%s\n' "cd screenshots/${SCREENSHOTS_GEN_FOLDER}" 'put -r corteza-e2e-cypress/cypress/screenshots/*' | sftp -q -o "StrictHostKeyChecking no" -i ${RELEASE_CRUST_KEY_FILE} ${RELEASE_CRUST_SFTP_URI}
- name: Send message on successful testing results
if: success()
uses: fadenb/[email protected]
env:
E2E_REPORTS_USER: ${{ secrets.E2E_REPORTS_USER }}
E2E_REPORTS_PASS: ${{ secrets.E2E_REPORTS_PASS }}
with:
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
channel: ${{ secrets.MATRIX_ROOM_ID }}
message: |
✅ E2e tests passed 🙌 🎉
🔗 https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASS }}@releases.cortezaproject.org/e2e-reports/
- name: Send message on failed testing results
if: failure()
uses: fadenb/[email protected]
env:
E2E_REPORTS_USER: ${{ secrets.E2E_REPORTS_USER }}
E2E_REPORTS_PASS: ${{ secrets.E2E_REPORTS_PASS }}
with:
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
channel: ${{ secrets.MATRIX_ROOM_ID }}
message: |
❌ E2e tests did not pass, screenshots provided
🔗 https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASS }}@releases.cortezaproject.org/e2e-reports/
📷 https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASS }}@releases.cortezaproject.org/e2e-reports/screenshots/${{ env.SCREENSHOTS_GEN_FOLDER }}/

0 comments on commit 71f98eb

Please sign in to comment.