-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support --tag argument #5164
Support --tag argument #5164
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…ag and --spec flags dynamically
- show err if passed without record flag - sanitize args into comma separated string - display tag in record errors
# Conflicts: # cli/__snapshots__/cli_spec.js # cli/lib/cli.js
# Conflicts: # cli/__snapshots__/cli_spec.js # cli/lib/cli.js # cli/lib/exec/run.js # packages/server/lib/modes/run.js # packages/server/lib/util/args.js
# Conflicts: # packages/server/lib/modes/run.js
Need to make an update based on this comment https://github.com/cypress-io/cypress-services/pull/1566#discussion_r339094829 to change sending
/pull/5164/files#diff-f558bdd26d5a0b4043bae0b9dc251e9fR291 |
- this will require a bump to json-schemas repo
# Conflicts: # cli/lib/cli.js # cli/test/lib/cli_spec.js
I tested this in staging and it is working, so the failed tests are likely just some weird snapshot diffs that need reconciling. |
# Conflicts: # packages/server/lib/modes/run.js
context "--tag", -> | ||
it "converts to array", -> | ||
options = @setup("--run-project", "foo", "--tag", "nightly,production,build") | ||
expect(options.tag[0]).to.eq("nightly") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we use single assertion here for complete message on error
expect(options.tag).to.deep.equal(['nightly', 'production', 'build'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, ran tests, added more tests, tested against staging - all seems 👍
* Alphabetize cli options for my own sanity * begin added tag flag * Fix some minor grammar in cli help output + be more specific for specs description * update snapshot based on alphabetization change * update snapshot to include --tag in help output * update logic for pulling out space delimited args to look through --tag and --spec flags dynamically * Support and pass along tag flag to run and record - show err if passed without record flag - sanitize args into comma separated string - display tag in record errors * fix some tests/snapshots where 'tag' was missing * Actually try passing in tag through tests to ensure it prints. * Merge branch 'develop' into issue-2561-tags # Conflicts: # cli/__snapshots__/cli_spec.js # cli/lib/cli.js # cli/lib/exec/run.js # packages/server/lib/modes/run.js # packages/server/lib/util/args.js * Send 'tags' as an array to backend API * Update json-schemas to query against 2.2.0 of postRun - this will require a bump to json-schemas repo * update test to reflect tags array * update snapshot to display nightly tag * rearrange args to alphabetical order in specs * Add tags to runResponses / remove tag from incorrect instance post * Fix failing specs / snapshots * Update error messages + snapshots * Fix snapshot that no longer displays tag arg * fix args unit test * remove extra slash * add a few more cli tests * another test just in case * a quick unit test for displayFlags utility Co-authored-by: Gleb Bahmutov <[email protected]>
TODO
cypress run --tag nightly
and then runningcypress run --tag staging
in parallel, where the run will become a single run. I think that it should attribute bothstaging
andnightly
to the single run. We would be postingtags: ["nightly"]
in one POST and thentags: ["staging"]
in the 2nd POST. https://github.com/cypress-io/cypress-services/issues/1812User facing changelog
Cypress now accepts a
--tag
argument to be used to distinguish separate runs. Any tags assigned will be shown on the run in the Cypress Dashboard.Additional details
tag
as singular, but always passing it as an Array to the cypress-api astags
How has the user experience changed?
Options are alphabetized + Tag option added to
--help
Error when passing space delimited
--spec
Error when passing space delimited
--tag
Tag added to beginning of recording run stdout
Displays as
false
by default.1 tag:
2 tags:
Dashboard displays the tags in the Runs list (only implementation right now)
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?