Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
592be54
feat: update cypress config base url based on environment
chasetmartin Oct 30, 2025
6d100a4
feat: type and zod schema regeneration
chasetmartin Oct 30, 2025
ab29866
feat: update cypress CI to use dockerized api application
chasetmartin Oct 30, 2025
1dfb83c
fix: update testing environment before docker compose up
chasetmartin Oct 31, 2025
e29978e
fix: add staging environment for cypress run
chasetmartin Oct 31, 2025
a2194d8
feat: update settings to api path and add seed data from transfers.se…
chasetmartin Oct 31, 2025
b928ef5
fix: update documentation wording
chasetmartin Oct 31, 2025
97b9ae5
fix: add seed script in same step as container start
chasetmartin Oct 31, 2025
4263e8d
fix: add cy wait to contact edit test
chasetmartin Oct 31, 2025
e68a5d2
fix: try cypress debug and removing second api url
chasetmartin Oct 31, 2025
1aa0700
fix: try another debug method
chasetmartin Oct 31, 2025
2c18d51
fix: try changing data provider api settings
chasetmartin Oct 31, 2025
6d05ed5
fix: try adding a curl request check
chasetmartin Oct 31, 2025
3be5cf4
fix: try a browser api endpoint check
chasetmartin Oct 31, 2025
aa9f58e
fix: another browser network test
chasetmartin Oct 31, 2025
58b7c9e
fix: try change how autocomplete works
chasetmartin Oct 31, 2025
1a4079f
fix: more logs
chasetmartin Oct 31, 2025
54672b9
fix: env variable update and logs
chasetmartin Oct 31, 2025
c7f39d9
fix: move test variable
chasetmartin Oct 31, 2025
53b3633
[test/setup] Vite test to use live FastAPI server
TylerAdamMartinez Nov 3, 2025
3b3cebf
[github/workflows/CI_testing] Combined cypress & vite tests to one wo…
TylerAdamMartinez Nov 4, 2025
f3e0dc4
[CI_testing] Swap seeder for real transfer
TylerAdamMartinez Nov 4, 2025
6119aae
[CI_testing] Now set to use experimental seeding branch
TylerAdamMartinez Nov 4, 2025
687d2e1
Mv it back to using the seeder
TylerAdamMartinez Nov 4, 2025
40994b0
Add INSTALL_DEV env & set it to true
TylerAdamMartinez Nov 4, 2025
046f74a
[CI_*] Split testing between vite & cypress
TylerAdamMartinez Nov 4, 2025
14436ed
[src/generated] update files
TylerAdamMartinez Nov 4, 2025
9d4e9ba
[vite test] revert files
TylerAdamMartinez Nov 4, 2025
ed19238
[settings] Vite test 4010 & cypress 8000
TylerAdamMartinez Nov 5, 2025
fc5c70b
[thing-well-screen] Patch test
TylerAdamMartinez Nov 5, 2025
7624c40
[cypress] rm waits
TylerAdamMartinez Nov 5, 2025
0fc1559
[settings] Add guard for node v vite builds
TylerAdamMartinez Nov 5, 2025
b84ebfb
[cypress/**/location_*] Patch test to circumvent USGS fetch
TylerAdamMartinez Nov 5, 2025
edd8cf6
[location_edit] Add coordinate method to fix broken test
TylerAdamMartinez Nov 5, 2025
7a095aa
[CI_cypress] Update backend sourcing branch
TylerAdamMartinez Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 53 additions & 39 deletions .github/workflows/CI_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,31 @@ on:
pull_request:

jobs:
install:
integration-tests:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cypress install
uses: cypress-io/github-action@v6
with:
# Disable running of tests within install job
runTests: false
build: npm run build
env:
VITE_BASE_URL: http://localhost:4173
VITE_OCOTILLO_API_URL: http://127.0.0.1:4010

- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: build
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was following the cypress docs example with this build and upload artifact step, but it seems redundant to me so I like that you removed it.

if-no-files-found: error
path: dist
env:
NODE_ENV: test
OCOTILLO_API_URL: http://localhost:8000
VITE_OCOTILLO_API_URL: http://localhost:8000
POSTGRES_USER: ${{ secrets.PG_TEST_USER }}
POSTGRES_PASSWORD: ${{ secrets.PG_TEST_PW }}
POSTGRES_DB: ${{ secrets.PG_TEST_DB }}
MODE: development
AUTHENTIK_DISABLE_AUTHENTICATION: ${{ secrets.AUTHENTIK_TEST }}

cypress-run:
runs-on: ubuntu-24.04
needs: install
steps:
- name: Checkout
- name: Checkout frontend
uses: actions/checkout@v4

- name: Setup Node.js
- name: Checkout FastAPI backend (NMSampleLocations staging)
uses: actions/checkout@v4
with:
repository: DataIntegrationGroup/NMSampleLocations
ref: staging
path: api-repo

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
Expand All @@ -43,21 +37,41 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Download the build folder
uses: actions/download-artifact@v4
with:
name: build
path: dist

- name: Start mock server
- name: Start FastAPI backend (Docker Compose)
working-directory: ./api-repo
env:
INSTALL_DEV: true
run: |
# Start mock server in background
npm run mock:server:cypress &
# Wait for server to start
sleep 10

- name: Cypress run
docker compose build --build-arg INSTALL_DEV=$INSTALL_DEV app
docker compose up -d
echo "Waiting for FastAPI to be ready..."
timeout 180 bash -c 'until curl -f http://localhost:8000/docs; do sleep 3; done'
echo "FastAPI is up and healthy"

- name: Seed database
working-directory: ./api-repo
run: docker compose exec -T app python -m transfers.seed

- name: Build frontend
run: npm run build
env:
VITE_BASE_URL: http://localhost:4173
VITE_OCOTILLO_API_URL: http://localhost:8000

- name: Run Cypress e2e tests
uses: cypress-io/github-action@v6
with:
start: npm start
browser: chrome
browser: chrome
spec: |
cypress/e2e/test-api-connectivity.cy.ts
cypress/e2e/ocotillo/**/*.cy.ts
env:
DEBUG: cypress:network:*,cypress:server:request
VITE_OCOTILLO_API_URL: http://localhost:8000

- name: Stop API containers
if: always()
working-directory: ./api-repo
run: docker compose down

4 changes: 3 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default defineConfig({
},

e2e: {
baseUrl: 'http://localhost:4173',
baseUrl: process.env.CI
? "http://localhost:4173"
: "http://localhost:5173",
setupNodeEvents(on, config) {
process.env.NODE_ENV = 'test'
},
Expand Down
Loading