Skip to content

Improve Github test ergonomics - #520

Open
ivanklee86 wants to merge 1 commit into
mainfrom
NOTIX_improve_github_test_ergonomics
Open

Improve Github test ergonomics#520
ivanklee86 wants to merge 1 commit into
mainfrom
NOTIX_improve_github_test_ergonomics

Conversation

@ivanklee86

Copy link
Copy Markdown
Owner
  • Add CLAUDE.md
  • Experiment with using Claude to improve test ergonomics.

Copilot AI review requested due to automatic review settings January 19, 2026 21:57

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 pull request refactors GitHub integration tests to improve ergonomics by introducing a dedicated github_token fixture that validates token availability and automatically skips tests when the token is not set. A comprehensive CLAUDE.md development guidelines document is also added to help contributors understand the project's coding standards and testing patterns.

Changes:

  • Introduced github_token fixture that validates token availability and skips tests gracefully
  • Refactored test files to use the new github_token fixture instead of directly accessing environment variables
  • Added comprehensive CLAUDE.md documentation covering coding style, testing patterns, and development workflows

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/fixtures.py Added github_token fixture with proper validation and test skipping; updated github_pr_clean to depend on it
tests/unit/reporters/test_gh.py Updated test functions to use github_token fixture parameter instead of os.getenv() calls; removed unused os import
tests/integration/test_cli.py Updated CLI test to use github_token fixture parameter; removed unused os import
CLAUDE.md Added comprehensive development guidelines document covering coding standards, testing patterns, and workflows
.devcontainer/post_install.sh Added Claude installation step to devcontainer setup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CLAUDE.md
Comment on lines +338 to +356
from dotenv import load_dotenv

@pytest.fixture
def secrets():
"""Load environment variables for tests requiring credentials."""
load_dotenv()
yield

@pytest.fixture
def github_pr_clean(secrets):
"""Provide a clean GitHub PR for testing."""
g = Github(os.getenv("RUBRICAL_TEST_GITHUB_ACCESS_TOKEN"))
repo = g.get_repo(GITHUB_REPO_NAME)
pr = repo.get_pull(GITHUB_TEST_PR)

# Cleanup before test
for issue_comment in pr.get_issue_comments():
issue_comment.delete()
time.sleep(5)

Copilot AI Jan 19, 2026

Copy link

Choose a reason for hiding this comment

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

The fixture example in the documentation is outdated and doesn't match the actual implementation. The github_pr_clean fixture now takes github_token as a parameter (not secrets), and should use the token parameter directly instead of calling os.getenv(). This example should be updated to match the new implementation in tests/fixtures.py.

Suggested change
from dotenv import load_dotenv
@pytest.fixture
def secrets():
"""Load environment variables for tests requiring credentials."""
load_dotenv()
yield
@pytest.fixture
def github_pr_clean(secrets):
"""Provide a clean GitHub PR for testing."""
g = Github(os.getenv("RUBRICAL_TEST_GITHUB_ACCESS_TOKEN"))
repo = g.get_repo(GITHUB_REPO_NAME)
pr = repo.get_pull(GITHUB_TEST_PR)
# Cleanup before test
for issue_comment in pr.get_issue_comments():
issue_comment.delete()
time.sleep(5)
from github import Github
@pytest.fixture
def github_pr_clean(github_token):
"""Provide a clean GitHub PR for testing."""
g = Github(github_token)
repo = g.get_repo(GITHUB_REPO_NAME)
pr = repo.get_pull(GITHUB_TEST_PR)
# Cleanup before test
for issue_comment in pr.get_issue_comments():
issue_comment.delete()

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +10
# Install Claude
curl -fsSL https://claude.ai/install.sh | bash

Copilot AI Jan 19, 2026

Copy link

Choose a reason for hiding this comment

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

The URL https://claude.ai/install.sh appears to be non-existent or incorrect. Claude is an AI assistant by Anthropic and doesn't have a standard shell installation script at this URL. This script will likely fail during the devcontainer setup. Consider removing this installation step or replacing it with the correct installation method for the intended tool.

Suggested change
# Install Claude
curl -fsSL https://claude.ai/install.sh | bash

Copilot uses AI. Check for mistakes.
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.

2 participants