Repository navigation
Workflow: browser default and tags input for Run tests - #196
Merged
Merged
Conversation
The generated test_pipeline.yml can now be dispatched with no inputs (browser defaults to chrome and is no longer required) and takes an optional tags input, passed to rspec as one --tag per comma- or space-separated tag. Blank tags run all tests exactly as before. The input reaches the step only through the TAGS env var; the whole value and each tag are checked against tag-like patterns before rspec starts, and anything else fails the step with exit 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a project generated by raider be started from Raider Hideout's Run tests (
workflow_dispatchontest_pipeline.yml), with or without tags.What changes in
lib/generators/infrastructure/templates/github.ttbrowserinput:required: false,default: chrome. A dispatch with no inputs now uses chrome (GitHub uses the default when an input is omitted).tagsinput (type: string, default''): RSpec tags separated by commas or spaces, each passed to rspec as--tag.smoke,@smoke(RSpec strips the@),smoke, fast(either tag),~slow(exclude),!slow(rewritten to~slow),type:api(tag with a value).inputs.tagsis''; blank or comma/space-only input leaves the args array empty, and"${tag_args[@]}"expands to nothing.Shell injection guard
TAGSenv var (TAGS: ${{ inputs.tags }}); no${{ }}appears insiderun:, so GitHub never pastes the value into the script.^[A-Za-z0-9@_:,.~! -]{0,200}$(Hideout's own charset; no newline, tab, quotes,$,;, backticks,*,/).read -r -asplits it on whitespace with no glob or command expansion; every expansion is quoted.^[~!]?@?[A-Za-z0-9_][A-Za-z0-9_.-]*(::?[A-Za-z0-9_.-]+)?$, so it can't start with-and is always the argument of--tag.::error::line before rspec starts. It never falls back to all tests.Scope
test_pipeline.yml(Cucumber and Watir were removed in 4.0.0), so there is no Cucumber--tagsvariant.azure_pipelines.tt, no dispatch inputs; Hideout dispatches GitHub only) and Appium (appium_pipeline.yml) are unchanged. Hideout's Tag input should stay blank for mobile projects: GitHub answers an unknown input with a 422.### 4.3.0 (unreleased)with the change and how an existing project updates its workflow by hand. The number is a pick; rename it at release.lib/versionstays 4.2.0.Verification
rspec(includesspec/utilitiesandspec/generators): 2281 examples, 0 failures, 10 pending.rspec spec/generators/: 312/0. rubocop: no offenses.reek .: 0 warnings. steep: no type errors.bundlethat records its argv: blank, unset and' , ,'give today's argv; 9 tag cases give the expected--tagargs; 20 hostile or invalid values ($(touch pwned), backticks,;,&&,*, quotes,-r x, newline, tab,a!b,~,a:, 201 chars, ...) exit 2 without callingbundleand without creating the file. Locally this runs on macOS bash 3.2; the Content validation job runs it on ubuntu's bash 5.actionlint1.7.12 with shellcheck reports 0 errors on the renderedtest_pipeline.ymland on the unchangedappium_pipeline.yml. In that project,rspec --dry-runon a probe spec selects 1 example for--tag @smoke, 2 for--tag smoke --tag slow, 3 for--tag ~slowand--tag ~@slow, 1 for--tag type:api;raider-reporter exec --passes the tags through.TAGSand runs in a temp dir; a tag allows one:value(soa:anda:b:care refused instead of silently matching nothing). Not changed: tags are checked in the Run tests step, after setup, so a value Hideout accepts but this check refuses (a!b, a lone~) fails after setup minutes rather than before.