Skip to content

Remove nomock services / env vars and make sure this breaks those tes… #6

Remove nomock services / env vars and make sure this breaks those tes…

Remove nomock services / env vars and make sure this breaks those tes… #6

Workflow file for this run

name: E2E Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push API Image
run: |
IMAGE_NAME=ghcr.io/hackforla/homeuniteus/api:latest
docker build -t $IMAGE_NAME ./api
docker push $IMAGE_NAME
build-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Testing Image
run: |
IMAGE_NAME=ghcr.io/hackforla/homeuniteus/app:latest-test
docker build --build-arg VITE_HUU_API_BASE_URL=http://127.0.0.1:8080/api --target development --tag $IMAGE_NAME ./app
docker push $IMAGE_NAME
- name: Build Production Image
run: |
IMAGE_NAME=ghcr.io/hackforla/homeuniteus/app:latest
docker build --build-arg VITE_HUU_API_BASE_URL=http://127.0.0.1:8080/api --target production --tag $IMAGE_NAME ./app
docker push $IMAGE_NAME
test-api-mock:
runs-on: ubuntu-latest
needs: [build-api]
container:
image: ghcr.io/hackforla/homeuniteus/api:latest
options: --entrypoint /bin/bash --no-healthcheck
steps:
- name: Run Tests With Backend Mocking
run: pytest
working-directory: /opt/HomeUniteUs/api
test-api-nomock:
runs-on: ubuntu-latest
needs: [build-api]
container:
image: ghcr.io/hackforla/homeuniteus/api:latest
options: --entrypoint /bin/bash --no-healthcheck
steps:
- name: Run Tests With Backend Mocking
run: pytest --mode=release
working-directory: /opt/HomeUniteUs/api
test-app-mock:
runs-on: ubuntu-latest
needs: [build-app, build-api]
services:
frontend:
image: ghcr.io/hackforla/homeuniteus/app:latest-test
env:
VITE_HUU_API_BASE_URL: http://127.0.0.1:8080/api
container:
image: ghcr.io/hackforla/homeuniteus/app:latest-test
options: --entrypoint /bin/bash --no-healthcheck
env:
CYPRESS_BASE_URL: http://frontend:4040
CYPRESS_USE_MOCK: true
steps:
- name: Run Tests With Backend Mocking
run: |
cd /app
npx cypress run
test-app-nomock:
runs-on: ubuntu-latest
needs: [build-app, build-api]
services:
frontend:
image: ghcr.io/hackforla/homeuniteus/app:latest-test
env:
VITE_HUU_API_BASE_URL: http://backend:8080/api
container:
image: ghcr.io/hackforla/homeuniteus/app:latest-test
options: --entrypoint /bin/bash --no-healthcheck
env:
CYPRESS_BASE_URL: http://frontend:4040
CYPRESS_USE_MOCK: false
CYPRESS_REAL_EMAIL: [email protected]
CYPRESS_REAL_PASSWORD: Test!123
steps:
- name: Test using a real backend
run: npx cypress run
working-directory: /app