Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No option to no_output_timeout on run-tests #430

Open
ghost opened this issue Jun 9, 2023 · 5 comments
Open

No option to no_output_timeout on run-tests #430

ghost opened this issue Jun 9, 2023 · 5 comments
Labels
e2e type: enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jun 9, 2023

When executing a long running test using cypress/run-tests on CircleCI, I am often finding that I get the error Too long with no output (exceeded 10m0s): context deadline exceeded. After looking online I saw that there used to be a timeout command which had a default timeout of 10 minutes (the test often goes to 10-15 mins) which could be overridden (#125). Could this be added to cypress/run-tests?

The orb does not work as expected

  • what version of the orb are you currently using? cypress-io/[email protected]
  • describe what you think should happen: timeout option should be available when running tests
  • describe what happens: Error thrown after 10 minutes, no step information is being output - Too long with no output (exceeded 10m0s): context deadline exceeded
@nagash77 nagash77 added type: enhancement New feature or request e2e labels Jun 9, 2023
@Phonesis
Copy link

Phonesis commented Aug 4, 2023

Any progress on this?

@jordanpowell88
Copy link
Contributor

You should be able to specify this yourself on your job itself. Have you given this a try @JP-Mat ?

@ghost
Copy link
Author

ghost commented Aug 8, 2023

I've tried both timeout and no_output_timeout and received the errors

Error calling command: 'cypress/run-tests'
Unexpected argument(s): no_output_timeout

Error calling command: 'cypress/run-tests'
Unexpected argument(s): timeout  

This used to exist as part of the 'run' job as the timeout property as far as I can tell

But there doesn't seem to be anything like it on the run-tests command or run job

@ghost
Copy link
Author

ghost commented Sep 1, 2023

Any update for this?

The change should be fairly trivial

https://github.com/cypress-io/circleci-orb/blob/master/src/commands/run-tests.yml

`description: >
  A single, complete job to run Cypress tests

parameters:
  working-directory:
    description: Directory containing package.json
    type: string
    default: "."
  start-command:
    description: Command used to start your local dev server for Cypress to tests against
    type: string
    default: ""
  cypress-command:
    description: Command used to run your Cypress tests
    type: string
    default: "npx cypress run"
  timeout: // Add this section
    description: Optional timeout for running tests
    type: string
    default: 10m
steps:
  - when:
      condition: << parameters.start-command >>
      steps:
        - run:
            name: Start Server
            command: << parameters.start-command >>
            background: true
            working_directory: << parameters.working-directory >>
  - run:
      name: Run Cypress
      command: << parameters.cypress-command >>
      working_directory: << parameters.working-directory >>
      no_output_timeout: << parameters.timeout >>  // Add this
  - store_artifacts:
      path: << parameters.working-directory >>/cypress/videos
  - store_artifacts:
      path: << parameters.working-directory >>/cypress/screenshots`

https://github.com/cypress-io/circleci-orb/blob/master/src/jobs/run.yml

description: >
  A single, complete job to run Cypress end-to-end tests in your application.
# What will this job do?
executor: default

parallelism: << parameters.parallelism >>

parameters:
  install-command:
    description: Overrides the default NPM command (npm ci)
    type: string
    default: ""
  post-install:
    description: >
      Additional commands to run after running install
      but before verifying Cypress and saving cache.
    type: string
    default: ""
  install-browsers:
    description: |
      Cypress runs by default in the Electron browser. Use this flag to install additional browsers to run your tests in.
      This is only needed if you are passing the `--browser` flag in your `cypress-command`.
      This parameter leverages the `circleci/browser-tools` orb and includes Chrome and FireFox.
      If you need additional browser support you can set this to false and use an executor with a docker image
      that includes the browsers of your choosing. See https://hub.docker.com/r/cypress/browsers/tags
    type: boolean
    default: false
  cypress-cache-key:
    description: Cache key used to cache the Cypress binary.
    type: string
    default: 'cypress-cache-{{ arch }}-{{ checksum "package.json" }}'
  cypress-cache-path:
    description: |
      By default, this will cache the '~/.cache/Cypress' directory so that the Cypress binary is cached. You can override this by providing your own cache path.
    type: string
    default: "~/.cache/Cypress"
  node-cache-version:
    type: string
    default: "v1"
    description: Change the default node cache version if you need to clear the cache for any reason.
  include-branch-in-node-cache-key:
    type: boolean
    default: false
    description: >
      If true, this cache will only apply to runs within the same branch. (Adds -{{ .Branch }}- to the node cache key)
  working-directory:
    description: Directory containing package.json
    type: string
    default: ""
  package-manager:
    type: enum
    enum: ["npm", "yarn", "yarn-berry"]
    default: "npm"
    description: Select the default node package manager to use. NPM v5+ Required.
  start-command:
    description: Command used to start your local dev server for Cypress to tests against
    type: string
    default: ""
  cypress-command:
    description: Command used to run your Cypress tests
    type: string
    default: "npx cypress run"
  parallelism:
    type: integer
    default: 1
    description: |
      Number of Circle machines to use for load balancing, min 1
      (requires `parallel` and `record` flags in your `cypress-command`)
  timeout:  // Add this section
    description: Optional timeout for running tests
    type: string
    default: 10m

steps:
  - install:
      install-command: << parameters.install-command >>
      post-install: << parameters.post-install >>
      cypress-cache-key: << parameters.cypress-cache-key >>
      cypress-cache-path: << parameters.cypress-cache-path >>
      node-cache-version: << parameters.node-cache-version >>
      working-directory: << parameters.working-directory >>
      package-manager: << parameters.package-manager >>
      include-branch-in-node-cache-key: << parameters.include-branch-in-node-cache-key >>
      install-browsers: << parameters.install-browsers >>
  - run-tests:
      working-directory: << parameters.working-directory >>
      start-command: << parameters.start-command >>
      cypress-command: << parameters.cypress-command >>
      timeout: << parameters.timeout >>  // Add this

@aheffernan-litify
Copy link

Any update on this? or a work around anyone has found to be successful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants