Skip to content

Commit

Permalink
Updates based on discussion in PR #206
Browse files Browse the repository at this point in the history
* Remove lambda-related Makefile commands
* Replace caplog.at_level with caplog.set_level in CLI test
* Remove coverage from Pipfile
  • Loading branch information
ehanson8 committed Dec 6, 2023
1 parent 1187644 commit 78d356d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 69 deletions.
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
docker push $(ECR_URL_DEV):latest
docker push $(ECR_URL_DEV):`git describe --always`

### If this is a Lambda repo, uncomment the two lines below ###
# update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
# aws lambda update-function-code --function-name $(FUNCTION_DEV) --image-uri $(ECR_URL_DEV):latest


### Terraform-generated manual shortcuts for deploying to Stage. This requires ###
### that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_STAGE environment ###
### variables are set locally by the developer and that the developer has ###
Expand All @@ -90,9 +85,5 @@ publish-stage: ## Only use in an emergency
docker push $(ECR_URL_STAGE):latest
docker push $(ECR_URL_STAGE):`git describe --always`

### If this is a Lambda repo, uncomment the two lines below ###
# update-lambda-stage: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
# aws lambda update-function-code --function-name $(FUNCTION_STAGE) --image-uri $(ECR_URL_STAGE):latest

run-dev: # Run in dev against Alma sandbox
aws ecs run-task --cluster alma-integrations-creditcardslips-ecs-dev --task-definition alma-integrations-creditcardslips-ecs-dev --launch-type="FARGATE" --network-configuration '{ "awsvpcConfiguration": {"subnets": ["subnet-0488e4996ddc8365b", "subnet-022e9ea19f5f93e65"],"securityGroups": ["sg-095372030a26c7753"],"assignPublicIp": "DISABLED"}}'
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ sentry-sdk = "*"
[dev-packages]
black = "*"
boto3-stubs = "*"
coverage = "*"
coveralls = "*"
freezegun = "*"
moto = "*"
Expand Down
59 changes: 28 additions & 31 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 27 additions & 28 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,30 @@ def test_cli_options_from_env(caplog, runner):


def test_cli_all_options_passed(caplog, runner):
with caplog.at_level(logging.DEBUG):
result = runner.invoke(
main,
[
"--source-email",
"[email protected]",
"--recipient-email",
"[email protected]",
"--recipient-email",
"[email protected]",
"--date",
"2023-01-02",
"--log-level",
"debug",
],
)
assert result.exit_code == 0
assert "Logger 'root' configured with level=DEBUG" in caplog.text
assert (
"Command called with options: {'source_email': '[email protected]', "
"'recipient_email': ('[email protected]', '[email protected]'), "
"'date': '2023-01-02', 'log_level': 'debug'}" in caplog.text
)
assert (
"Credit card slips processing complete for date 2023-01-02. Email sent to "
"recipient(s) ('[email protected]', '[email protected]')"
in caplog.text
)
caplog.set_level(logging.DEBUG)
result = runner.invoke(
main,
[
"--source-email",
"[email protected]",
"--recipient-email",
"[email protected]",
"--recipient-email",
"[email protected]",
"--date",
"2023-01-02",
"--log-level",
"debug",
],
)
assert result.exit_code == 0
assert "Logger 'root' configured with level=DEBUG" in caplog.text
assert (
"Command called with options: {'source_email': '[email protected]', "
"'recipient_email': ('[email protected]', '[email protected]'), "
"'date': '2023-01-02', 'log_level': 'debug'}" in caplog.text
)
assert (
"Credit card slips processing complete for date 2023-01-02. Email sent to "
"recipient(s) ('[email protected]', '[email protected]')" in caplog.text
)

0 comments on commit 78d356d

Please sign in to comment.