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

Setup for Concourse CI #256

Open
jennifer-shehane opened this issue Jun 4, 2019 · 8 comments
Open

Setup for Concourse CI #256

jennifer-shehane opened this issue Jun 4, 2019 · 8 comments

Comments

@jennifer-shehane
Copy link
Member

We've had a couple people inquire about running in Concourse CI, especially with parallel runs. Would be nice to get an example.

Also, collecting CI env vars in the test runner will likely be helpful cypress-io/cypress#4376

@eaustin
Copy link

eaustin commented Dec 13, 2019

Are there any updates on this?

@bahmutov
Copy link
Contributor

No @eaustin - if there is a commercial ConcourseCI hosting that we can turn on, we would be happy to

@smccormack-kr
Copy link

Would also be interested if there are any updates on this. When I try to run cypress with parallel runs for concourse, I get a response of it not being able to determine the ciBuildId. But I see concourse listed under the list for "The ciBuildId is automatically detected if you are running Cypress in any of the these CI providers"

An example to help implement would be very useful in this case to help me see what I am doing wrong.

@pdibenedetto
Copy link

A Concourse Example under the Kitchen Sink project would be extremely valuable for Parallel runs.

@EnorMOZ
Copy link

EnorMOZ commented Oct 7, 2020

Has anyone got this working?

@KadeejaBai
Copy link

KadeejaBai commented Jun 2, 2021

Any updates ?? I do get the same error as @smccormack-kr mentioned

@opanitch
Copy link

opanitch commented Nov 3, 2021

In our Monorepo, we had some additional authentication factors to pass through to Cypress, so to get it working in our Concourse pipeline, I used the following config:

resource_types:
    - name: pull-request
      type: docker-image
      source:
          repository: teliaoss/github-pr-resource

    - name: slack
      type: docker-image
      source:
          repository: cfcommunity/slack-notification-resource
          tag: latest

resources:
    - name: slack
      icon: slack
      type: slack
      source:
          url: ((project.slack_url))

    - name: ((project.resources.test_e2e.name))
      type: time
      source: ((project.resources.test_e2e.source))

    # Merge Resource
    - name: ((project.resources.merge.name))
      icon: github
      type: git
      source:
          uri: ((git-uri))
          branch: ((branch))
          paths: ((project.resources.merge.paths))

jobs:
    # Merge Tasks
    - name: ((project.jobs.test_e2e.name))
      plan:
          - get: ((project.resources.merge.name))
            version: latest
          - get: time-trigger
            trigger: true
          - in_parallel:
                fail_fast: true
                steps:
                    - task: install-repository
                      file: ((project.resources.merge.name))/.concourse/tasks/((project.id))/install-repository.task.yaml
                      input_mapping:
                          ci-src: ((project.resources.merge.name))
                    - task: install-project
                      file: ((project.resources.merge.name))/.concourse/tasks/((project.id))/install-project.task.yaml
                      input_mapping:
                          ci-src: ((project.resources.merge.name))
          - task: test-e2e
            file: ((project.resources.merge.name))/.concourse/tasks/((project.id))/test-e2e.task.yml
            input_mapping:
                ci-src: ((project.resources.merge.name))
            params:
                CYPRESS_BASE_URL: ((baseUrl))
                USERNAME: ((e2e-test-username-user))
                PASSWORD: ((e2e-test-password-user))
                CLIENT_SECRET: ((e2e-test-client-secret-my-apps))
      serial: true
      on_abort:
          do:
              - put: slack
                params:
                    channel: ((slack-channel))
                    text: |
                        <!channel> ((project.name)) e2e-testing aborted
                        ((concourse-url))/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
      on_error:
          do:
              - put: slack
                params:
                    channel: ((slack-channel))
                    text: |
                        <!channel> Task error when running e2e testing for ((project.name))
                        ((concourse-url))/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
      on_failure:
          do:
              - put: slack
                params:
                    channel: ((slack-channel))
                    text: |
                        <!channel> e2e tests Failed for ((project.name))
                        ((concourse-url))/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
      on_success:
          do:
              - put: slack
                params:
                    channel: ((slack-channel))
                    text: |
                        ((project.name)) e2e tests have successfully passed
                        ((concourse-url))/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME

task:

---
platform: linux

image_resource:
    type: docker-image
    source:
        repository: cypress/base

inputs:
    - name: ci-src
    - name: ci-src/node_modules
    - name: ci-src/projects/my-apps-ui/node_modules

run:
    dir: ci-src
    path: .concourse/tasks/my-apps-ui/test-e2e.task.sh

script:

#!/bin/bash

if [ $? -ne 0 ]; then
    exit 1
fi

pushd projects/my-apps-ui \
    && npx cypress install \
    && npm run test-e2e -- --config baseUrl=$CYPRESS_BASE_URL  --env username=$USERNAME,password=$PASSWORD,clientSecret=$CLIENT_SECRET

@trainoasis
Copy link

@opanitch how's parallelization handled in your code? What have I missed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants