diff --git a/.github/workflows/assets/client/config.js b/.github/workflows/assets/client/config.js new file mode 100644 index 0000000000..5a1ef8564c --- /dev/null +++ b/.github/workflows/assets/client/config.js @@ -0,0 +1,4 @@ +// Corteza API location +window.CortezaAPI = '//localhost:8888/api' + +window.i18nPseudoModeEnabled = false diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index fa9ba3351c..47f3458024 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -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 @@ -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: @@ -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 }} @@ -213,3 +194,43 @@ 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} + + notify-failure: + needs: [ server-client-setup ] + runs-on: ubuntu-20.04 + if: failure() + steps: + - name: Send message on failed testing results + uses: fadenb/matrix-chat-message@v0.0.6 + 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 }}/ + + notify-success: + needs: [ server-client-setup ] + runs-on: ubuntu-20.04 + if: success() + steps: + - name: Send message on successful testing results + uses: fadenb/matrix-chat-message@v0.0.6 + 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/