Skip to content

Commit

Permalink
Config: Eliminate aws-testing (#12508)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 2f4fbc40519b9e0b7b6410207c96c6ea941e1a84
  • Loading branch information
stephencpope authored and Descartes Labs Build committed Mar 25, 2024
1 parent 891f410 commit 169b593
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 39 deletions.
10 changes: 5 additions & 5 deletions descarteslabs/config/settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ usage_url = "@format {this.PLATFORM_URL}/usage/v1"
vector_url = "@format {this.PLATFORM_URL}/vector/v1"
yaas_url = "@format {this.PLATFORM_URL}/yaas/v1"

[aws-testing]
# testing is now for aws but keep this until it is removed everywhere
default_domain = "@format dev.aws.{this.DOMAIN}"
platform_url = "@format https://platform.{this.DEFAULT_DOMAIN}"
[local]
# feel free to mess with anything here as needed
default_domain = "dev.localhost"
platform_url = "@format https://platform.dev.aws.descarteslabs.com"
testing = true

catalog_v2_url = "@format {this.PLATFORM_URL}/metadata/v1/catalog/v2"
compute_url = "@format {this.PLATFORM_URL}/compute/v1"
iam_url = "@format https://iam.{this.DEFAULT_DOMAIN}"
iam_url = "@format https://{this.DEFAULT_DOMAIN}:8000"
metadata_url = "@format {this.PLATFORM_URL}/metadata/v1"
raster_url = "@format {this.PLATFORM_URL}/raster/v2"
usage_url = "@format {this.PLATFORM_URL}/usage/v1"
Expand Down
10 changes: 1 addition & 9 deletions descarteslabs/config/tests/settings.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
["testing"]
testing = "hello"
iam_url = "https://aws_url"

["aws-testing"]
testing = "hello"
iam_url = "https://aws_url"

["gcp-testing"]
testing = "hello"
iam_url = "https://gcp_url"
iam_url = "https://test_url"
32 changes: 7 additions & 25 deletions descarteslabs/config/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_get_settings(self):

def test_peek_settings(self):
current_env = os.environ["DESCARTESLABS_ENV"]
env = "aws-testing"
env = "aws-production"
settings = Settings.peek_settings(env)
assert os.environ["DESCARTESLABS_ENV"] == current_env
assert settings.env == env
Expand All @@ -105,22 +105,17 @@ def test_bad_env(self):

def test_default_auth(self):
a = Auth()
a.domain == "http://gcp_url"
assert a.domain == "https://iam.dev.aws.descarteslabs.com"

def test_auth_with_env(self):
with patch.dict(os.environ, {"DESCARTESLABS_ENV": "aws-testing"}):
with patch.dict(os.environ, {"DESCARTESLABS_ENV": "aws-production"}):
a = Auth()
a.domain == "http://aws_url"
assert a.domain == "https://iam.production.aws.descarteslabs.com"

def test_auth_with_aws_config(self):
Settings.select_env("aws-testing")
def test_auth_with_test_config(self):
Settings.select_env("aws-production")
a = Auth()
a.domain == "http://aws_url"

def test_auth_with_gcp_config(self):
Settings.select_env("testing")
a = Auth()
a.domain == "http://gcp_url"
assert a.domain == "https://iam.production.aws.descarteslabs.com"

def test_env(self):
peek1_env = "aws-dev"
Expand Down Expand Up @@ -175,19 +170,6 @@ class VerifyValues(unittest.TestCase):
"VECTOR_URL": "https://platform.staging.aws.descarteslabs.com/vector/v1",
"YAAS_URL": "https://platform.staging.aws.descarteslabs.com/yaas/v1",
},
"aws-testing": {
"CATALOG_V2_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1/catalog/v2",
"COMPUTE_URL": "https://platform.dev.aws.descarteslabs.com/compute/v1",
"IAM_URL": "https://iam.dev.aws.descarteslabs.com",
"LOG_LEVEL": "WARNING",
"METADATA_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1",
"PLATFORM_URL": "https://platform.dev.aws.descarteslabs.com",
"RASTER_URL": "https://platform.dev.aws.descarteslabs.com/raster/v2",
"TESTING": True,
"USAGE_URL": "https://platform.dev.aws.descarteslabs.com/usage/v1",
"VECTOR_URL": "https://platform.dev.aws.descarteslabs.com/vector/v1",
"YAAS_URL": "https://platform.dev.aws.descarteslabs.com/yaas/v1",
},
"testing": {
"CATALOG_V2_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1/catalog/v2",
"COMPUTE_URL": "https://platform.dev.aws.descarteslabs.com/compute/v1",
Expand Down

0 comments on commit 169b593

Please sign in to comment.