Skip to content

Run rerun_failed_tests.py without a shell - #4236

Closed
KemalG-u wants to merge 2 commits into
plotly:devfrom
KemalG-u:fix/issue-4229
Closed

KemalG-u wants to merge 2 commits into
plotly:devfrom
KemalG-u:fix/issue-4229

Conversation

@KemalG-u

@KemalG-u KemalG-u commented Dec 2, 2026

Copy link
Copy Markdown

Start with a description of this PR. Then edit the list below to the items that make sense for your PR scope, and check off the boxes as you go!

Contributor Checklist

  • This PR targets dev (fix or chore) or next (feature, new API, breaking change), see Which branch to target
  • I have broken down my PR scope into the following TODO tasks
    • task 1
    • task 2
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Change and verification

rerun_failed_tests.py joined the failed test names into one string and ran it through subprocess.run(..., shell=True), so a test name containing shell characters (a parametrized id, a quote, ; or $(...)) was interpreted by the shell. The names are now passed to pytest as an argument list and no shell is used. Two unit tests pin this: one checks the command is a list without shell=True, one checks that parse_test_results returns the failed names from a JUnit file.

Closes #4229.

Verification

  • Regression test python -m pytest -q tests/unit/test_rerun_failed_tests.py -p no:cacheprovider: fails with only the new test applied and passes with the fix; both runs were executed automatically in an isolated CI environment.

@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

@T4rk1n T4rk1n mentioned this pull request Dec 2, 2026
1 task done
@T4rk1n

T4rk1n commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix. It turned out rerun_failed_tests.py was no longer run anywhere (its only caller was a CircleCI-era npm script), so #4237 deleted it instead. Closing this one as superseded.

@T4rk1n T4rk1n closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Command injection via subprocess shell=True in rerun_failed_tests.py

2 participants