Skip to content

Commit

Permalink
Configure AppConfig integration test against staging (#113)
Browse files Browse the repository at this point in the history
* configure integration test against staging
  • Loading branch information
limorl authored Aug 3, 2024
1 parent 5733436 commit 8764141
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions infra/terraform/modules/tests/fake_secrets.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

resource "aws_secretsmanager_secret" "fake_secret_plain" {
name = "test/fake-secret-plain"
description = "Fake secret used in integration tests"
description = "Fake secret (plain text) used in integration tests"
recovery_window_in_days = 0

tags = merge(
Expand All @@ -19,7 +19,7 @@ resource "aws_secretsmanager_secret_version" "fake_secret_plain_value" {

resource "aws_secretsmanager_secret" "fake_secret_pair" {
name = "test/fake-secret-pair"
description = "Fake secret used in integration tests"
description = "Fake secret (key-value pair) used in integration tests"
recovery_window_in_days = 0


Expand Down
2 changes: 1 addition & 1 deletion infra/terraform/modules/tests/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "appconfig_app" {
source = "../appconfig-app"
app_name = "test-service"
app_name = "test-appconfig-service"
env_name = var.stage
tags = var.tags
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def configuration_with_populated_secrets():
def service_env():
clear_service_environment()
os.environ['PLATFORM'] = 'AWS'
os.environ['STAGE'] = 'dev'
os.environ['REGION'] = 'us-west-2'
os.environ['STAGE'] = 'staging'
os.environ['REGION'] = 'us-east-1'
os.environ['SERVICE_NAME'] = 'test-appconfig'

config_folder = os.path.join(pathlib.Path(__file__).parent.resolve(), 'config')
Expand Down
10 changes: 10 additions & 0 deletions packages/configuration/tests/config/aws.dev.eu-west-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"GooConfiguration": {
"int1": 1,
"str2": "2",
"secrets": {
"secret_plain": "secret:test/fake-secret-plain",
"secret_pair": "secret:test/fake-secret-pair"
}
}
}
10 changes: 0 additions & 10 deletions packages/configuration/tests/config/aws.dev.us-west-2.json

This file was deleted.

10 changes: 10 additions & 0 deletions packages/configuration/tests/config/aws.staging.us-east-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"GooConfiguration": {
"int1": 1,
"str2": "2",
"secrets": {
"secret_plain": "secret:test/fake-secret-plain",
"secret_pair": "secret:test/fake-secret-pair"
}
}
}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export = "poetry_plugin_export.plugins:ExportApplicationPlugin"
# Note that due to how pytest handles test discovery, the order of paths matter. Changing the order can cause issues.
[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
markers = [
"integration: marks integration tests (deselect with '-m \"not integration\"')"
]
pythonpath = [
"packages/configuration",
"packages/environment",
Expand Down

0 comments on commit 8764141

Please sign in to comment.