-
Notifications
You must be signed in to change notification settings - Fork 25
test: prefer github app auth in integration fixtures #790
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6f995fb
test: prefer github app auth in integration fixtures
cbartz e204e3d
style: revert unrelated conftest formatting churn
cbartz c804691
test: read github app private keys from env only
cbartz 05fa8d9
test: remove fork path change integration coverage
cbartz 0aea0b4
ci: drop removed fork path change test from workflow
cbartz f39ac7a
test: remove unused alt token from integration fixtures
cbartz 3f01385
ci: drop rot-prone slot-to-var comments from workflows
cbartz 485da79
test: read github token from env only
cbartz ada84b1
ci: wire additional secret slots for app auth credentials
cbartz 635b291
ci: pass github app client id to charm integration tests
cbartz cbe4ed6
chore: remove outdated skip of test_charm_upgrade
cbartz 441350b
test: hide secrets from integration config reprs
cbartz df614ed
docs: clarify github_config fixture input sources
cbartz 0407945
docs: narrow env-fallback claim to app id options
cbartz eb29b20
style: restore inline textwrap.dedent formatting
cbartz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
github-runner-manager/tests/unit/test_integration_factories.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # See LICENSE file for licensing details. | ||
|
|
||
| """Unit tests for integration test factories.""" | ||
|
|
||
| from tests.integration.factories import GitHubConfig, create_default_config | ||
|
|
||
|
|
||
| def test_create_default_config_uses_token_auth_by_default(): | ||
| """ | ||
| arrange: A GitHub test config without GitHub App credentials. | ||
| act: Build the integration test application config. | ||
| assert: The GitHub auth block uses token auth. | ||
| """ | ||
| config = create_default_config( | ||
| github_config=GitHubConfig( | ||
| token="ghp_test_token_1234567890abcdef", | ||
| path="canonical/example", | ||
| ) | ||
| ) | ||
|
|
||
| assert config["github_config"]["auth"] == {"token": "ghp_test_token_1234567890abcdef"} | ||
|
|
||
|
|
||
| def test_create_default_config_uses_github_app_auth_when_available(): | ||
| """ | ||
| arrange: A GitHub test config with complete GitHub App credentials. | ||
| act: Build the integration test application config. | ||
| assert: The GitHub auth block uses GitHub App auth. | ||
| """ | ||
| config = create_default_config( | ||
| github_config=GitHubConfig( | ||
| token="ghp_test_token_1234567890abcdef", | ||
| path="canonical/example", | ||
| app_client_id="Iv23liExample", | ||
| installation_id=456, | ||
| private_key="-----BEGIN PRIVATE KEY-----\nabc\n-----END PRIVATE KEY-----", | ||
| ) | ||
| ) | ||
|
|
||
| assert config["github_config"]["auth"] == { | ||
| "app_client_id": "Iv23liExample", | ||
| "installation_id": 456, | ||
| "private_key": "-----BEGIN PRIVATE KEY-----\nabc\n-----END PRIVATE KEY-----", | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.