diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 6b3da229..6ceeaa94 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -5,12 +5,6 @@ on: push: pull_request: workflow_dispatch: - inputs: - debug_enabled: - type: boolean - description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" - required: false - default: false jobs: pre: @@ -30,7 +24,7 @@ jobs: build: name: Build/Test needs: pre - if: needs.pre.outputs.should_skip != 'true' + if: ${{ github.event_name == 'workflow_dispatch' || needs.pre.outputs.should_skip != 'true' }} runs-on: ${{ matrix.os }} timeout-minutes: 60 strategy: @@ -43,6 +37,14 @@ jobs: submodules: recursive fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + #if: ${{ github.event_name == 'workflow_dispatch' }} + timeout-minutes: 30 + with: + detached: true + limit-access-to-actor: true + - name: Cache images uses: ScribeMD/docker-cache@0.3.7 with: @@ -63,8 +65,8 @@ jobs: EOF cat <> ./client/.env NODE_ENV=development - MAILBOX_URL="wss://mailbox.stage.winden.app/v1" - RELAY_URL="wss://relay.stage.winden.app" + MAILBOX_URL="ws://$IP:8080/mailbox/v1" + RELAY_URL="ws://$IP:8080/relay" EOF printf "Client .env:\n" cat ./client/.env @@ -98,17 +100,13 @@ jobs: docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile e2e \ run --rm --no-deps -e CI=true client-e2e npm clean-install - - name: Start devserver + - name: Start containers run: | docker compose --progress plain up -d client docker compose exec client ./scripts/wait-for-webpack.sh docker compose ps docker compose logs client - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} - - name: Run UNIT and INTEGRATION tests run: docker compose run --rm client npm run test -- --coverage diff --git a/client-e2e/test/pageobjects/page.ts b/client-e2e/test/pageobjects/page.ts index 603eea15..299d876b 100644 --- a/client-e2e/test/pageobjects/page.ts +++ b/client-e2e/test/pageobjects/page.ts @@ -1,4 +1,4 @@ -export const homePageUrl = `https://client:8080`; +export const homePageUrl = `http://client:8080`; export async function open() { const url = await browser.url(homePageUrl); diff --git a/client-e2e/test/wdio.conf.ts b/client-e2e/test/wdio.conf.ts index d399f0e6..317252c8 100644 --- a/client-e2e/test/wdio.conf.ts +++ b/client-e2e/test/wdio.conf.ts @@ -56,7 +56,7 @@ export const config: Options.Testrunner = { ], logLevel: "error", bail: 0, - baseUrl: "https://client:8080", + baseUrl: "http://client:8080", waitforTimeout: 10000, connectionRetryTimeout: 60000, connectionRetryCount: 2, diff --git a/client/.env.example b/client/.env.example index 16c68a3b..f9482d0d 100644 --- a/client/.env.example +++ b/client/.env.example @@ -3,11 +3,8 @@ SFTP_USERNAME= SFTP_IDENTITY= SFTP_HOSTNAME= -SENTRY_AUTH_TOKEN= -SENTRY_DSN="https://72cfb64fd40a470c9a87b9225308cec1@o1314989.ingest.sentry.io/6566456" - # stage server for mailbox and relay -MAILBOX_URL="wss://mailbox.stage.mw.leastauthority.com/v1" -RELAY_URL="wss://relay.stage.mw.leastauthority.com" +MAILBOX_URL="wss://mailbox.stage.winden.app/v1" +RELAY_URL="wss://relay.stage.winden.app" NODE_ENV=development diff --git a/client/scripts/devserver.ts b/client/scripts/devserver.ts index 779d1343..3106a072 100644 --- a/client/scripts/devserver.ts +++ b/client/scripts/devserver.ts @@ -1,7 +1,8 @@ import express from "express"; import fs from "fs"; import { createProxyMiddleware } from "http-proxy-middleware"; -import https from "https"; +//import https from "https"; +import http from "http"; import path from "path"; import webpack from "webpack"; import webpackDevMiddleware from "webpack-dev-middleware"; @@ -56,12 +57,13 @@ app.get("*", (req, res) => { res.sendFile(path.join(__dirname, "../src/public/index.html")); }); -const server = https.createServer( - { - key: fs.readFileSync(path.join(__dirname, "../certs/server.key")), - cert: fs.readFileSync(path.join(__dirname, "../certs/server.cert")), - passphrase: "gulp", - }, +//const server = https.createServer( +const server = http.createServer( + // { + // key: fs.readFileSync(path.join(__dirname, "../certs/server.key")), + // cert: fs.readFileSync(path.join(__dirname, "../certs/server.cert")), + // passphrase: "gulp", + // }, app ); diff --git a/client/scripts/wait-for-webpack.sh b/client/scripts/wait-for-webpack.sh index 4da438bf..31cf4226 100755 --- a/client/scripts/wait-for-webpack.sh +++ b/client/scripts/wait-for-webpack.sh @@ -3,7 +3,7 @@ printf "Waiting for webpack to compile...\n" while :; do sleep 1 printf . - status="$(curl -s -k "https://localhost:8080/bundle-status")" + status="$(curl -s -k "http://localhost:8080/bundle-status")" if [[ $status =~ "true" ]]; then break fi diff --git a/docker-compose.yml b/docker-compose.yml index 143efc19..8fc07470 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,17 @@ services: - mailbox - relay - feedback-api + healthcheck: + test: + [ "CMD", "curl", "-fk", + "https://localhost:8080/", + "https://localhost:8080/v1", + "https://localhost:8080/mailbox", + "https://localhost:8080/relay", + ] + interval: 30s + timeout: 10s + retries: 1 feedback-api: build: ./feedback-api command: