Skip to content

fix: Remove unnecessary shell quoting from GITHUB_ENV write - #2613

Closed
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/test-wheel-windows-remove-unnecessary-shell-quoting-from
Closed

fix: Remove unnecessary shell quoting from GITHUB_ENV write#2613
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/test-wheel-windows-remove-unnecessary-shell-quoting-from

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in .github/workflows/test-wheel-windows.yml: Remove unnecessary shell quoting from GITHUB_ENV write.

Changes

  • .github/workflows/test-wheel-windows.yml: Remove unnecessary shell quoting from GITHUB_ENV write.

Details

--- a/.github/workflows/test-wheel-windows.yml
+++ b/.github/workflows/test-wheel-windows.yml
@@ -1,1 +1,1 @@
-        run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV"
+        run: echo "PYTEST_ADDOPTS=--count=${{ inputs.nruns }}" >> "$GITHUB_ENV"

Tests

  • cuda_core/tests/test_ci_env.py
--- /dev/null
+++ b/cuda_core/tests/test_ci_env.py
@@ -0,0 +1,18 @@
+import os
+import shlex
+
+
+def test_pytest_addopts_no_literal_quotes():
+    """Ensure PYTEST_ADDOPTS, if set by CI, does not contain literal quotes.
+
+    GitHub Actions env-file values are taken literally after the '=', so
+    escaped quotes written to $GITHUB_ENV become part of the value.  This
+    test guards against that regression.
+    """
+    opts = os.environ.get("PYTEST_ADDOPTS", "")
+    if not opts:
+        return
+    assert not (opts.startswith('"') and opts.endswith('"')), (
+        f"PYTEST_ADDOPTS contains literal quotes: {opts!r}"
+    )
+    # Ensure pytest can still parse the value.
+    shlex.split(opts)

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Aug 13, 2026
@mdboom

mdboom commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

To be honest, I don't mind it as-is, even though it's unnecessary. If we change that to a more complex expression that does need the quoting we are less likely to have an issue. I'm going to close this one.

@mdboom mdboom closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants