You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on github action docker compose with Cyprus service command I'm getting the following error: "the input device is not a tty"
I have to mention that I don't have any interactivity whatsoever to my knowledge, or any -it -i flags in my code.
This is the responsible command: command: ["sh", "-c", "CI=1 npx cypress run --config video=false --e2e --no-exit --headless --no-tty --browser chrome -- --no-sandbox"]
This is the docker compose Cypress service
(the `` inline code markdown does not look good on a large block of code)
command: ["sh", "-c", "CI=1 npx cypress run --config video=false --e2e --no-exit --headless --no-tty --browser chrome -- --no-sandbox"]
deploy:
resources:
limits:
cpus: "2.0"
memory: "4G"
healthcheck:
test: ["CMD-SHELL", "curl", "-f", "http://cypress-tests:3001 || exit 1"]
interval: 10s # The time between health checks.
retries: 10 # The number of times to retry the health check before considering it a failure.
start_period: 60s # The time to wait before the first health check.
timeout: 5s # The time to wait for a health check to complete before considering it a failure.
depends_on:
client:
condition: service_started
networks:
- app-network
This is the docker file:
`
# Use the official Cypress image as the base image
FROM cypress/base:20.14.0
# instead of bitnami/cypress:13.12.0
# Define the build argument
ARG CYPRESS_VERSION
# Set the container run time env
ENV VITE_FIREBASE_API_KEY=${VITE_FIREBASE_API_KEY}
ENV VITE_AUTH_DOMAIN=${VITE_AUTH_DOMAIN}
ENV VITE_PROJECT_ID=${VITE_PROJECT_ID}
ENV VITE_STORAGE_BUCKET=${VITE_STORAGE_BUCKET}
ENV VITE_MESSAGING_SENDER_ID=${VITE_MESSAGING_SENDER_ID}
ENV VITE_APP_ID=${VITE_APP_ID}
ENV VITE_NODE_ENV=${VITE_NODE_ENV}
ENV VITE_APP_API_ENDPOINT=${VITE_APP_API_ENDPOINT}
ENV CYPRESS_VERSION=${CYPRESS_VERSION}
# Print the environment variable
RUN echo "CYPRESS_VERSION: ${CYPRESS_VERSION}"
# Set the working directory
WORKDIR /container-cy
COPY ./package*.json ./
RUN npm install
RUN npx cypress cache clear
USER root
# Set Cypress cache folder to /tmp (writable in non-root environments)
ENV CYPRESS_CACHE_FOLDER=/tmp/.cache/Cypress
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all....
on github action docker compose with Cyprus service command I'm getting the following error: "the input device is not a tty"
I have to mention that I don't have any interactivity whatsoever to my knowledge, or any -it -i flags in my code.
This is the responsible command:
command: ["sh", "-c", "CI=1 npx cypress run --config video=false --e2e --no-exit --headless --no-tty --browser chrome -- --no-sandbox"]
This is the docker compose Cypress service
(the `` inline code markdown does not look good on a large block of code)
cypress-tests:
container_name: d-compose-cy
working_dir: /container-cy
image: ${DOCKER_HUB_PATH}container-cy:latest
build:
context: ./client
dockerfile: Dockerfile.cy
args:
CYPRESS_VERSION: ${CYPRESS_VERSION}
ports:
- "3001:3001"
environment:
DEBUG: "true"
VITE_FIREBASE_API_KEY: ${VITE_FIREBASE_API_KEY}
VITE_AUTH_DOMAIN: ${VITE_AUTH_DOMAIN}
VITE_PROJECT_ID: ${VITE_PROJECT_ID}
VITE_STORAGE_BUCKET: ${VITE_STORAGE_BUCKET}
VITE_MESSAGING_SENDER_ID: ${VITE_MESSAGING_SENDER_ID}
VITE_APP_ID: ${VITE_APP_ID}
VITE_NODE_ENV: "development"
VITE_APP_API_ENDPOINT: "http://server:8000"
CYPRESS_VERSION: ${CYPRESS_VERSION}
volumes:
- ./client/cypress:/container-cy/cypress
- ./client/cypress.config.mjs:/container-cy/cypress.config.mjs
- ./client/package.json:/container-client-dev/package.json
This is the docker file:
`
# Use the official Cypress image as the base image
FROM cypress/base:20.14.0
# instead of bitnami/cypress:13.12.0
# Define the build argument
ARG CYPRESS_VERSION
# Set the container run time env
ENV VITE_FIREBASE_API_KEY=${VITE_FIREBASE_API_KEY}
ENV VITE_AUTH_DOMAIN=${VITE_AUTH_DOMAIN}
ENV VITE_PROJECT_ID=${VITE_PROJECT_ID}
ENV VITE_STORAGE_BUCKET=${VITE_STORAGE_BUCKET}
ENV VITE_MESSAGING_SENDER_ID=${VITE_MESSAGING_SENDER_ID}
ENV VITE_APP_ID=${VITE_APP_ID}
ENV VITE_NODE_ENV=${VITE_NODE_ENV}
ENV VITE_APP_API_ENDPOINT=${VITE_APP_API_ENDPOINT}
ENV CYPRESS_VERSION=${CYPRESS_VERSION}
# Print the environment variable
RUN echo "CYPRESS_VERSION: ${CYPRESS_VERSION}"
# Set the working directory
WORKDIR /container-cy
COPY ./package*.json ./
RUN npm install
RUN npx cypress cache clear
USER root
# Set Cypress cache folder to /tmp (writable in non-root environments)
ENV CYPRESS_CACHE_FOLDER=/tmp/.cache/Cypress
# Install curl dependencies
RUN apt-get update && apt-get install -y curl
RUN mkdir -p /container-cy/node_modules/@esbuild/aix-ppc64 && chmod -R 777 /container-cy/node_modules
USER root
RUN npm install -g cypress@$CYPRESS_VERSION
RUN npm install --unsafe-perm cypress@$CYPRESS_VERSION
RUN ls -la /tmp/.cache/Cypress
RUN echo $CYPRESS_CACHE_FOLDER
RUN find / -name Cypress
USER root
RUN chmod +x /tmp/.cache/Cypress/${CYPRESS_VERSION}/Cypress/Cypress
# grant r/w permissions
RUN chmod -R 777 .
# Copy the rest of the client application code after installing dependencies
COPY ./ ./
# grant r/w permissions
RUN chmod -R 777 .
# Ensure the Cypress binary has proper permissions
RUN chmod -R 755 /tmp/.cache/Cypress
# Set PATH for Cypress and the current working directory
ENV PATH /container-cy/node_modules/.bin:$PATH
# Verify Cypress installation
RUN npx cypress verify
RUN useradd -m cypressuser
USER cypressuser
WORKDIR /container-cy
# Run Cypress tests
# CMD ["sh", "-c", "while ! nc -z react-app 3000; do sleep 1; done; npx cypress run --config video=false --e2e"]
# CMD ["sh", "-c", "sleep 10 && while ! nc -z client 3000; do sleep 120; done; npx cypress run --config video=false --e2e"]
# CMD ["sh", "-c", "sleep 10 && while ! curl -s http://client:3000 > /dev/null; do sleep 3; done; npx cypress run --config video=false --e2e"]
# CMD ["sh", "-c", "sleep 30 && timeout 360s sh -c 'while ! curl http://client:3000; do sleep 3; done; npx cypress run --config video=false --e2e'"]
CMD ["sh", "-c", "echo 'Waiting for client to be available...' && while ! curl -s http://client:3000; do sleep 1; echo 'Waiting...'; done; echo 'Client is up! Running tests...A' && timeout 360s npx cypress run --config video=false --e2e"]
`
What else????
Best regards!!!
Beta Was this translation helpful? Give feedback.
All reactions