Skip to content

Fix global tox test matrix failures and linters - #367

Open
royrhea wants to merge 1 commit into
open-telemetry:mainfrom
royrhea:fix-test-matrix-linters
Open

Fix global tox test matrix failures and linters#367
royrhea wants to merge 1 commit into
open-telemetry:mainfrom
royrhea:fix-test-matrix-linters

Conversation

@royrhea

@royrhea royrhea commented Aug 9, 2026

Copy link
Copy Markdown

Description

Please include a summary of the change and which issue, if any, is fixed.
Include the motivation and context for the change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. List any relevant details for your test
configuration.

  • Test A

Checklist

See CONTRIBUTING.md
for the style guide, changelog guidance, and more.

  • Followed the style guidelines of this project
  • Changelog updated if the change requires an entry
  • Unit tests added
  • Documentation updated

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 9, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-14 16:40 UTC

Respond to 4 review items (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1, 2, 3, 4
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to stabilize repo-wide CI/linting by reducing noise and failures from generated/virtualenv directories and aligning pytest-asyncio behavior with expected fixture scoping.

Changes:

  • Update the shellcheck tox env to skip .tox, .venv, and test_env directories and avoid running shellcheck when no scripts are found.
  • Exclude test_env from the license-header checker and codespell scans.
  • Set pytest-asyncio’s default fixture loop scope to function via pytest.ini.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tox.ini Adjusts shellcheck invocation and directory exclusions for repo-wide lint stability.
scripts/check_license_header.py Skips test_env to avoid false failures when scanning for SPDX headers.
pytest.ini Sets asyncio_default_fixture_loop_scope to reduce asyncio/fixture-related test failures.
.codespellrc Excludes test_env from spelling checks to avoid scanning generated environments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tox.ini

commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"
sh -c "find {toxinidir} -type f -name \*.sh -not -path '*/.tox/*' -not -path '*/.venv/*' -not -path '*/test_env/*' | xargs --no-run-if-empty shellcheck --severity=warning"
@lmolkova lmolkova added the Skip Changelog PR does not require a changelog entry label Aug 14, 2026
Comment thread pytest.ini
addopts = -rfE -v
log_cli = true
log_cli_level = warning
asyncio_default_fixture_loop_scope = function

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't reach the packages that define their own [tool.pytest.ini_options]. pytest stops its config lookup at the package pyproject.toml and never reads root pytest.ini. Affected: anthropic, agno, crewai, smolagents, llama-index, claude-agent-sdk. Those envs will keep emitting the warning.

Simplest fix: drop the [tool.pytest.ini_options] blocks from those six pyproject.tomls so root config applies everywhere. Otherwise the setting has to be duplicated into each.

"target",
".tox",
".venv",
"test_env",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_env looks like a local venv name rather than a repo convention. .gitignore uses venv*/ and .venv*/, so this is better handled there, or by renaming the venv to venv-test, instead of adding it to three shared configs.

SKIP_DIRS matches path components anywhere, so this also means any real directory named test_env silently skips the license-header gate.

Suggested change
"test_env",

Same for the ./test_env entry in .codespellrc.

Comment thread tox.ini

commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"
sh -c "find {toxinidir} -type f -name \*.sh -not -path '*/.tox/*' -not -path '*/.venv/*' -not -path '*/test_env/*' | xargs --no-run-if-empty shellcheck --severity=warning"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exclusion list misses venv/, which .gitignore explicitly allows, so a conventionally named local venv still gets scanned. Suggest driving the exclusions off the .gitignore patterns and dropping test_env:

Suggested change
sh -c "find {toxinidir} -type f -name \*.sh -not -path '*/.tox/*' -not -path '*/.venv/*' -not -path '*/test_env/*' | xargs --no-run-if-empty shellcheck --severity=warning"
sh -c "find {toxinidir} -type f -name \*.sh -not -path '*/.tox/*' -not -path '*/.venv*/*' -not -path '*/venv*/*' | xargs shellcheck --severity=warning"

--no-run-if-empty is GNU-only and never triggers here since find always matches the scripts in scripts/, so leaving it off keeps the command working on macOS too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PR does not require a changelog entry

Development

Successfully merging this pull request may close these issues.

3 participants