Skip to content

Commit

Permalink
Modify test command
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrujanaReddy committed Aug 11, 2024
1 parent 1f876d5 commit b19b2c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ jobs:
run: docker compose up -d && sleep 10

- name: Run unit tests
run: docker compose run --rm app npm test
run: npm test

- name: Run integration tests
run: |
docker compose run --rm app npx sequelize-cli db:drop
docker compose run --rm app npx sequelize-cli db:create
docker compose run --rm app npx sequelize-cli db:migrate
docker compose run --rm app npm run start:dev &
npx sequelize-cli db:drop
npx sequelize-cli db:create
npx sequelize-cli db:migrate
npm run start:dev &
sleep 10
docker compose run --rm app npm install cypress cypress-json-results
docker compose run --rm app npx cypress run
npm install cypress cypress-json-results
npx cypress run
- name: Setup SSH
run: |
Expand Down
22 changes: 1 addition & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,4 @@ FROM base as dev
ENV NODE_ENV=development
RUN npm install -g nodemon && npm install
COPY . /app
CMD npm run start
# # Download dependencies as a separate step to take advantage of Docker's caching.
# # Leverage a cache mount to /root/.npm to speed up subsequent builds.
# # Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
# # into this layer.
# RUN --mount=type=bind,source=package.json,target=package.json \
# --mount=type=bind,source=package-lock.json,target=package-lock.json \
# --mount=type=cache,target=/root/.npm \
# npm ci --omit=dev

# # Run the application as a non-root user.
# USER node

# # Copy the rest of the source files into the image.
# COPY . .

# # Expose the port that the application listens on.
# EXPOSE 5000

# # Run the application.
# CMD npm start
CMD npm run start

0 comments on commit b19b2c9

Please sign in to comment.