Code Monkey home page Code Monkey logo

cuke-skywalker's Introduction

cuke-skywalker

Cucumber Skywalker

Distribute Cucumber features to workers run in parallel.

Installation

This module requires a peerDependency of the cucumber package.

npm install --save-dev cucumber cuke-skywalker

Usage

./node_modules/.bin/cuke-skywalker --tags '@this and not @that'

All arguments will be passed directly to the workers. Features will be pre-filtered to get an accurate feature count, which is used to chunk them for the "uniform" distribution method.

Distribution Methods

roundrobin

This creates a queue of features and a set of worker pipelines. These pipelines grab features one at a time until the queue is exhausted. Use this method to leverage workers more efficiently.

uniform

This chunks features into uniformly-sized groups and sends them to each worker all at once. It results in fewer output files but can leave workers with nothing to do while longer feature sets are still running elsewhere.

Options

Options are passed as environment variables.

Variable Default Description
CUCUMBER_PARALLEL_WORKERS 4 Number of worker processes to distribute features to
CUCUMBER_PARALLEL_REPORT_DIR reports Output directory for worker output JSON files
CUCUMBER_PARALLEL_DISTRIBUTION roundrobin Method for distributing features (roundrobin or uniform)
CUCUMBER_JS_PATH node_modules/.bin/cucumber-js Path to the cucumber-js bin

HTML Report

cucumber-html-reporter is available to generate a decent-looking HTML reporter across all workers.

./node_modules/.bin/cuke-skywalker-report

CUCUMBER_PARALLEL_REPORT_DIR is used for the reports directory containing the worker output, and is also where the output is written. PLATFORM and ENVIRONMENT are available for metadata values.

cuke-skywalker's People

Contributors

dependabot[bot] avatar jody-zeitler avatar kyoheiyazawa avatar tomatobrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuke-skywalker's Issues

Error - '.' is not recognized as an internal or external command

node ./node_modules/cuke-skywalker/bin/cuke-skywalker

Cucumber version: 4.2.1
Doling out 2 features across 4 workers as they are available.
1 features remaining
0 features remaining
'.' is not recognized as an internal or external command,
operable program or batch file.

Error: worker exited with code 1
at ChildProcess.worker.on (C:\Bitbucket\Reckon.Stp.Jellyfish\node_modules\cuke-skywalker\index.js:162:12)
at ChildProcess.emit (events.js:159:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
'.' is not recognized as an internal or external command,
operable program or batch file.

Error: worker exited with code 1
at ChildProcess.worker.on (C:\Bitbucket\Reckon.Stp.Jellyfish\node_modules\cuke-skywalker\index.js:162:12)
at ChildProcess.emit (events.js:159:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
2 workers had failures.

Tests Appear To Be Running Twice When I Execute Using Default Parameters

Hi there,

I checked out your repo. It looks great. However it would seem the tests run twice when I run in parallel...

My use case is the following...

  1. I have 2 feature files that have a scenario each
  2. I use cucumber profiles for my test execution meaning I have a cucumber.js file at the project root folder
  3. The main thread I pass flag '--dry-run' so not to repeat running the tests again on the main thread. I set that within the cucumber.js profile file

Please see the output from the test run below...

/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run e2e-test-parallel --scripts-prepend-node-path=auto

> [email protected] e2e-test-parallel /Users/bhrein.brannick/Documents/src/testcafe-poc/testcafe-cucumber
> node $NODE_DEBUG_OPTION ./node_modules/cuke-skywalker/bin/cuke-skywalker

Cucumber version: 4.2.1
Runner Is Been Sent ./gherkin/**/*.feature --require ./step_definitions/*.js --require ./cucumber/*.js --dry-run
Doling out 2 features across 4 workers as they are available.
1 features remaining
0 features remaining
Parallel Worker Thread Executing Feature File gherkin/github.feature
Runner Is Been Sent gherkin/github.feature --require ./step_definitions/*.js --require ./cucumber/*.js --world-parameters '{"browser":"chrome"}'
World Has Been Called By PID 18517
Running Test Scenario 'Searching for TestCafe on GitHub' Under PID 18517
 Running tests in:
 - Chrome 68.0.3440 / Mac OS X 10.13.6

 fixture
The Test Controller Is Ready Now
..... ✓ test


 1 passed (7s)
.World Has Been Called By PID 18517
Running Test Scenario 'Searching for TestCafe on GitHub' Under PID 18517
 Running tests in:
 - Chrome 68.0.3440 / Mac OS X 10.13.6

 fixture
The Test Controller Is Ready Now
..... ✓ test


 1 passed (5s)
.

1 scenario (1 passed)
4 steps (4 passed)
0m29.826s

Parallel Worker Thread Executing Feature File gherkin/google.feature
Runner Is Been Sent gherkin/google.feature --require ./step_definitions/*.js --require ./cucumber/*.js --world-parameters '{"browser":"chrome"}'
World Has Been Called By PID 18518
Running Test Scenario 'Searching for TestCafe by Google' Under PID 18518
 Running tests in:
 - Chrome 68.0.3440 / Mac OS X 10.13.6

 fixture
The Test Controller Is Ready Now
..... ✓ test (screenshots: reports/screenshots/2018-08-29_18-15-53/test-1)


 1 passed (10s)
.World Has Been Called By PID 18518
Running Test Scenario 'Searching for TestCafe by Google' Under PID 18518
 Running tests in:
 - Chrome 68.0.3440 / Mac OS X 10.13.6

 fixture
The Test Controller Is Ready Now
..... ✓ test (screenshots: reports/screenshots/2018-08-29_18-16-11/test-1)


 1 passed (8s)
.

1 scenario (1 passed)
4 steps (4 passed)
0m33.612s


Process finished with exit code 0

The overall test results at the end list the scenario been run which passes although looking at the test run output unfortunately it does seem to execute the test twice. Observing the browser windows open that was my thinking but the log statements for me prove it beyond reasonable doubt. Thoughts? Let me know if you need any more info and thanks in advance.

Support Cucumber 4

cucumber@4 was released last month. Update our peer dependency and make sure it's compatible. It doesn't appear to break anything we rely upon.

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.