Skip to content

Commit

Permalink
# This is a combination of 21 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

IGVF-35-cypress-circleci

Try the cypress orb.

# This is the commit message #2:

Revert "IGVF-35-cypress-circleci"

This reverts commit fa1521f.

# This is the commit message #3:

IGVF-35-cypress-circleci

Revert last change and try a different tactic using docker-compose.test.yml.

# This is the commit message #4:

Revert "IGVF-35-cypress-circleci"

This reverts commit 2e7ad9c.

# This is the commit message #5:

IGVF-35-cypress-circleci

Another attempt to run Cypress in CircleCI.

# This is the commit message #6:

IGVF-35-cypress-circleci

Alter previous attempt.

# This is the commit message #7:

IGVF-35-cypress-circleci

Try two docker-compose files; one specifically for cypress.

# This is the commit message #8:

IGVF-35-cypress-circleci

Possibly the wrong command to start Cypress.

# This is the commit message #9:

IGVF-35-cypress-circleci

Try to solve EACCES error for Cypress cache.

# This is the commit message #10:

IGVF-35-cypress-circleci

Try setting environment variable for Cypress in through the docker-compose file.

# This is the commit message #11:

IGVF-35-cypress-circleci

Fix error setting the environment variable from the last fix.

# This is the commit message #12:

IGVF-35-cypress-circleci

Try a different cypress cache directory

# This is the commit message #13:

IGVF-35-cypress-circleci

Everyone seems to recommend a different syntax. Here’s yet another.

# This is the commit message #14:

IGVF-35-cypress-circleci

Downgrading node in case cypress-io/cypress#15025 is correct.

# This is the commit message #15:

IGVF-35-cypress-circleci

Try apt-get for cypress dependencies.

# This is the commit message #16:

Revert "IGVF-35-cypress-circleci"

This reverts commit f7b66a5.

# This is the commit message #17:

IGVF-35-cypress-circleci

Try using the Cypress orb.

# This is the commit message #18:

IGVF-35-cypress-circleci

Start the server before starting the Cypress tests.

# This is the commit message #19:

IGVF-35-cypress-circleci

Correction to last commit. Options can have very subtle effects on required syntax.

# This is the commit message #20:

Updated config.yml
# This is the commit message #21:

IGVF-35-cypress-circleci

Do a build and run of production build.
  • Loading branch information
forresttanaka committed Mar 8, 2022
1 parent fa1521f commit 969cfb5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
version: 2.1

orbs:
cypress: cypress-io/cypress@1.29.0
cypress: cypress-io/cypress@1

workflows:
igvf-ui-tests:
jobs:
- run-tests
- cypress/run
- cypress/run:
start:
- npm run build
- npm run start
wait-on: "http://localhost:3000"

jobs:
run-tests:
Expand All @@ -24,10 +28,10 @@ jobs:
- run:
name: Run tests
command: |
docker-compose -f docker-compose.test.yml up --exit-code-from nextjs
docker-compose -f docker-compose.test.yml up --exit-code-from nextjs
- store_artifacts:
path: coverage
- run:
name: Upload coverage
command: |
docker-compose -f docker-compose.test.yml run --no-deps -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN nextjs npx coveralls < ./coverage/lcov.info
docker-compose -f docker-compose.test.yml run --no-deps -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN nextjs npx coveralls < ./coverage/lcov.info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
/cypress/videos/app.spec.js.mp4

# next.js
/.next/
Expand Down
Binary file removed cypress/videos/app.spec.js.mp4
Binary file not shown.
3 changes: 1 addition & 2 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.8"

services:

nextjs:
build:
context: .
Expand All @@ -13,4 +12,4 @@ services:
- "/igvf-ui/.next"
command: npm test -- --coverage
ports:
- "3000:3000"
- "3000:3000"
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.14.0-alpine
FROM node:14.19.0-alpine

WORKDIR /docker

Expand All @@ -16,4 +16,4 @@ COPY . .

RUN npm run build

ENTRYPOINT ["/docker/entrypoint.sh"]
ENTRYPOINT ["/docker/entrypoint.sh"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "next start",
"lint": "next lint",
"test": "jest",
"cypress": "cypress open"
"cypress": "cypress run"
},
"dependencies": {
"@heroicons/react": "^1.0.6",
Expand Down

0 comments on commit 969cfb5

Please sign in to comment.