Skip to content

Commit

Permalink
Lint clean-up, testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jusdino committed Jun 4, 2024
1 parent 71d9ba6 commit 404f479
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
13 changes: 7 additions & 6 deletions backend/bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ REPORT="$1"

# Run CDK tests, tracking code coverage in a new data file
pytest --cov=. --cov-config=.coveragerc tests || exit "$?"
for dir in lambdas delete-objects-lambda
(
cd "$dir"
# Run lambda tests, appending data to the same data file
pytest --cov=. --cov-config=.coveragerc --cov-append tests
) || exit "$?"
for dir in lambdas delete-objects-lambda; do
(
cd "$dir"
# Run lambda tests, appending data to the same data file
pytest --cov=. --cov-config=.coveragerc --cov-append tests
) || exit "$?"
done

# Run a coverage report with the combined data
coverage html --fail-under=90
Expand Down
2 changes: 1 addition & 1 deletion backend/common_constructs/python_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
}
defaults.update(kwargs)

super().__init__(
super().__init__( # pylint: disable=missing-kwoa
scope, construct_id,
bundling=BundlingOptions(command_hooks=TestingHooks()),
runtime=Runtime.PYTHON_3_12,
Expand Down
12 changes: 12 additions & 0 deletions backend/delete-objects-lambda/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
include =
**/*.py
data_file = ../.coverage

omit =
*/cdk.out/*
*/smoke-test/*
*/tests/*

[report]
skip_empty = true
2 changes: 1 addition & 1 deletion backend/lambdas/tests/function/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TstFunction(TstLambdas):
Base class to set up Moto mocking and create mock AWS resources for functional testing
"""

def setUp(self):
def setUp(self): # pylint: disable=invalid-name
super().setUp()

self._os_patch = patch.dict(os.environ, {
Expand Down
2 changes: 1 addition & 1 deletion backend/stacks/persistent_stack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
access_logs_bucket=self.access_logs_bucket,
encryption_key=self.shared_encryption_key,
removal_policy=removal_policy,
auto_delete_objects=False if environment_name == 'prod' else True
auto_delete_objects=environment_name != 'prod'
)

self.board_users = BoardUsers(
Expand Down

0 comments on commit 404f479

Please sign in to comment.