-
Notifications
You must be signed in to change notification settings - Fork 7
Fix/linting #33
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
Fix/linting #33
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7ea61c5
tests(lint): Ignore false-positive
merkata d6b10c4
fix(lint): Address linting issues
merkata cfd2421
chore(lint): Lint integration tests
merkata 1e66bbc
fix(config): Rename config value
merkata 0b8049d
chore(lint): Lint unit tests
merkata 9e7352e
ci(lint): Add pylint
merkata d01c2ea
tests(unit): Remove SIMULATE_CAN_CONNECT
merkata ffcff39
chore(tests): Refactor tests
merkata 722f216
chore(docs): Put copyright before docstring
merkata c9f7fea
chore(docs): Put copyright before docstring
merkata 8cd1917
ci(lint): Refactor to avoid pylint disable
merkata 11e5b51
fix(unit): Rework rake task
merkata 94489c9
chore(docs): Add deleted comment
merkata 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# Copyright 2022 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
"""Module for test customizations.""" | ||
|
||
|
||
def pytest_addoption(parser): | ||
"""Adds parser switches.""" | ||
parser.addoption("--discourse-image", action="store") | ||
parser.addoption("--s3-url", action="store") |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright 2022 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
"""Discourse integration tests fixtures.""" | ||
|
||
import asyncio | ||
import logging | ||
|
@@ -15,20 +16,20 @@ | |
logger = logging.getLogger(__name__) | ||
|
||
|
||
@fixture(scope="module") | ||
def metadata(): | ||
@fixture(scope="module", name="metadata") | ||
def fixture_metadata(): | ||
"""Provides charm metadata.""" | ||
yield yaml.safe_load(Path("./metadata.yaml").read_text()) | ||
yield yaml.safe_load(Path("./metadata.yaml").read_text(encoding="UTF-8")) | ||
|
||
|
||
@fixture(scope="module") | ||
def app_name(metadata): | ||
@fixture(scope="module", name="app_name") | ||
def fixture_app_name(metadata): | ||
"""Provides app name from the metadata.""" | ||
yield metadata["name"] | ||
|
||
|
||
@fixture(scope="module") | ||
def app_config(): | ||
@fixture(scope="module", name="app_config") | ||
def fixture_app_config(): | ||
"""Provides app config.""" | ||
yield { | ||
"developer_emails": "[email protected]", | ||
|
@@ -76,7 +77,8 @@ async def app(ops_test: OpsTest, app_name: str, app_config: Dict[str, str], pyte | |
await ops_test.model.wait_for_idle() | ||
|
||
# Add required relations | ||
assert ops_test.model.applications[app_name].units[0].workload_status == WaitingStatus.name # type: ignore | ||
unit = ops_test.model.applications[app_name].units[0] | ||
assert unit.workload_status == WaitingStatus.name # type: ignore | ||
await asyncio.gather( | ||
ops_test.model.add_relation(app_name, "postgresql-k8s:db-admin"), | ||
ops_test.model.add_relation(app_name, "redis-k8s"), | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# Copyright 2022 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
import ops.testing | ||
|
||
ops.testing.SIMULATE_CAN_CONNECT = True | ||
"""Ops testing settings.""" |
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.