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

[WIP] Dry-run mode #1825

Merged
merged 6 commits into from Aug 15, 2019

Conversation

@DavertMik
Copy link
Member

commented Aug 4, 2019

In this mode, you can print tests output with no commands actually being executed.
This mode disables all helpers and plugins but preserves all events and console output, so you can easily see what all tests are doing, and validate your tests before running them completely

Usage

npx codeceptjs dry-run

OUTPUT

Screenshot from 2019-08-06 02-44-30

When passed --steps or --debug option runs tests, disabling all plugins and helpers, so you can get step-by-step report with no tests actually executed.

npx codeceptjs dry-run --steps

If a plugin needs to be enabled in dry-run mode, pass its name in -p option:

npx codeceptjs dry-run --steps -p allure

OUTPUT

Screenshot from 2019-08-05 12-04-51

@pablopaul

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

@DavertMik what is the use case for dry mode?

@DavertMik

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2019

@pablopaul Use cases:

  • To print all test scenarios in a human-readable format on a screen
  • Create reports for tests without running them
  • Check actual steps will be executed when a test will be run.
  • Dry run mode can also be used as validator for JS tests (validate all tests before running them), however, it has limitations working with grep* so I'm not sure about this use-case. However, if all custom code is stored in helpers and not used in tests, such validation will pass
@DavertMik

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2019

Btw, the similar PR for mocha was never merged mochajs/mocha#1070

@Codeception Codeception deleted a comment from codacy-bot Aug 6, 2019

@Codeception Codeception deleted a comment from codacy-bot Aug 6, 2019

@Codeception Codeception deleted a comment from codacy-bot Aug 10, 2019

@codacy-bot

This comment has been minimized.

Copy link

commented Aug 10, 2019

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- lib/session.js  1
- lib/within.js  1
- lib/command/dryRun.js  9
         

Clones added
============
- test/runner/dry_run_test.js  18
- lib/command/dryRun.js  1
         

See the complete overview on Codacy

@Codeception Codeception deleted a comment from codacy-bot Aug 10, 2019

@DavertMik DavertMik merged commit f5175cb into master Aug 15, 2019

6 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Hound No violations found. Woof!
ci/circleci: docker Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details

@DavertMik DavertMik deleted the dry-run branch Aug 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.