Coder Social home page Coder Social logo

cypress-split-example's Introduction

cypress-split-example cypress version cypress-split version

Split Cypress specs on GitHub Actions and CircleCI

Using the free plugin cypress-split without any external services

Cypress split on GitHub Actions

๐Ÿ“ Read the blog post Run Cypress Specs In Parallel For Free.

CI name Workflow CI status
GitHub Actions ci.yml ci
Reusable GHA reusable.yml reusable
CircleCI config.yml CircleCI

Reusable workflow via cypress-workflows

Small print

Author: Gleb Bahmutov <[email protected]> ยฉ 2023

License: MIT - do anything with the code, but don't blame me if it does not work.

cypress-split-example's People

Contributors

bahmutov avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cypress-split-example's Issues

Error: Do not know how to determine the correct split using AWS CodeBuild

Research Done:

Using your existing GitLab CI example, I have tried to mimic this in AWS CodeBuild project as follows:

Created CodeBuild buildspec file:

Using reference from cypress-realworld-app:

version: 0.2

batch:
  fast-fail: false
  build-matrix:
    dynamic:
      env:
        compute-type:
          - BUILD_GENERAL1_MEDIUM
          WORKERS:
            - 1
            - 2

phases:
  install:
    commands:
      - yarn install --frozen-lockfile
  build:
    commands:
      - npx @bahmutov/print-env CI_
      - npx cypress run --env split=true

Updated Cypress.config.ts as follows:

import { defineConfig } from 'cypress';
import cypressSplit from 'cypress-split'

export default defineConfig({

  e2e: {
    baseUrl: 'http://localhost:3000',
    specPattern: 'cypress/e2e/**/*.cy.ts',
    testIsolation: true,
    setupNodeEvents(on, config) {
      cypressSplit(on, config)
      // IMPORTANT: return the config object
      return config
    },
  },

Error after executed Cypress headless mode:

Error: Do not know how to determine the correct split
--
676 | at cypressSplit (/codebuild/output/src/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/cypress-split-gitlab-example/node_modules/cypress-split/src/index.js:78:13)
677 | at setupNodeEvents (file:///codebuild/output/src/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/cypress-split-gitlab-example/cypress.config.ts:10:13)
678 | at /root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:122:14
679 | at tryCatcher (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
680 | at Promise.attempt.Promise.try (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
681 | at RunPlugins.load (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:119:9)
682 | at RunPlugins.runSetupNodeEvents (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:59:17)
683 | at EventEmitter.<anonymous> (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:185:22)
684 | at EventEmitter.emit (node:events:514:28)
685 | at process.<anonymous> (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
686 | at process.emit (node:events:514:28)
687 | at emit (node:internal/child_process:951:14)
688 | at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Question:

Q1. How to use this package with AWS Codebuild?
Q2. In .gitlab-ci.yml there is flag parallel: 3 being used! Where to place this flag in AWS CodeBuild buildspec file?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

circleci
.circleci/config.yml
github-actions
.github/workflows/badges.yml
  • actions/checkout v4
  • stefanzweifel/git-auto-commit-action v5
  • ubuntu 22.04
.github/workflows/ci.yml
  • actions/checkout v4
  • cypress-io/github-action v5
  • actions/checkout v4
  • cypress-io/github-action v5
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/reusable.yml
  • bahmutov/cypress-workflows v1
npm
package.json
  • cypress ^13.3.0
  • cypress-split 1.24.0
  • prettier ^3.0.0
  • typescript ^5.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.