Skip to content

test(fix): destroy the default integration before testing #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Jun 30, 2025

Starting in 2025.05.0, a default integration is created by Connect. We want to destroy that integration before running the test suite.

@tdstein tdstein changed the title tests: use unique identifiers for all tests test: use unique identifiers for all tests Jun 30, 2025
Copy link

github-actions bot commented Jun 30, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1900 1791 94% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 4e469de by action🐍

@tdstein tdstein requested a review from Copilot June 30, 2025 17:53
Copy link

@Copilot Copilot AI left a comment

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 refactors tests to use dynamically generated identifiers instead of hardcoded values, preventing collisions in integration test runs.

  • Introduces a new fixtures.py module for generating unique names, emails, usernames, and passwords.
  • Updates all integration tests (and one production method) to pull values from fixtures rather than literals.
  • Tweaks client test assertions to use the MockSession return value.

Reviewed Changes

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

Show a summary per file
File Description
tests/posit/connect/test_hooks.py Expanded the deprecation warning match parameter
tests/posit/connect/test_client.py Updated session call assertions to use MockSession
src/posit/connect/users.py Replaced hardcoded password with fixtures.password()
integration/tests/posit/connect/fixtures.py Added fixtures module for unique test data
integration/tests/posit/connect/***.py Replaced literal test data with calls to fixtures
Comments suppressed due to low confidence (2)

src/posit/connect/users.py:365

  • The code now references fixtures.password() but fixtures is not imported—add from posit.connect.tests.fixtures import password, name, email, username (or the correct import path) at the top of this file.
        ...     password=fixtures.password(),

integration/tests/posit/connect/test_system.py:44

  • Path is used here but not imported—add from pathlib import Path near the top of this test file.
        path = (Path(__file__).parent / path).resolve()

@tdstein tdstein requested a review from mconflitti-pbc July 1, 2025 15:37
@tdstein tdstein changed the title test: use unique identifiers for all tests test(fix): destroy the default integration before testing Jul 1, 2025
Copy link
Collaborator

@cgraham-rs cgraham-rs left a comment

Choose a reason for hiding this comment

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

Seems clear and concise. The consistency and naming improvements were a nice improvement.

@tdstein tdstein merged commit c4cefe9 into main Jul 7, 2025
42 checks passed
@tdstein tdstein deleted the tdstein/main branch July 7, 2025 21:45
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.

3 participants