aplos-nca-saas-sdk 0.0.3__tar.gz → 0.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/.vscode/settings.json +1 -2
  2. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/PKG-INFO +3 -2
  3. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/devops/pypi/build.py +3 -3
  4. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/pyproject.toml +4 -3
  5. aplos_nca_saas_sdk-0.0.5/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +13 -0
  6. aplos_nca_saas_sdk-0.0.5/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings.py +60 -0
  7. aplos_nca_saas_sdk-0.0.5/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +105 -0
  8. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/configs/login.py +35 -7
  9. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +3 -1
  10. aplos_nca_saas_sdk-0.0.5/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +38 -0
  11. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +18 -9
  12. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/main.py +22 -3
  13. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +3 -3
  14. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/version.py +1 -1
  15. aplos_nca_saas_sdk-0.0.3/src/aplos_nca_saas_sdk/integration_testing/configs/app_config.py +0 -25
  16. aplos_nca_saas_sdk-0.0.3/src/aplos_nca_saas_sdk/integration_testing/configs/config.py +0 -21
  17. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/.gitignore +0 -0
  18. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/.pypirc +0 -0
  19. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/.vscode/launch.json +0 -0
  20. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/LICENSE +0 -0
  21. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/README.md +0 -0
  22. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/devops/pypi/readme.md +0 -0
  23. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/devops/requirements.txt +0 -0
  24. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/docs/images/API_Configuration_blur.png +0 -0
  25. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/docs/images/aplos-nca-commandline-cropped.png +0 -0
  26. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/docs/images/aplos-nca-commandline.png +0 -0
  27. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/mypy.ini +0 -0
  28. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/mypy_checks.py +0 -0
  29. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/readme.md +0 -0
  30. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/requirements.txt +0 -0
  31. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/run-checks.sh +0 -0
  32. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/__init__.py +0 -0
  33. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/aws_resources/aws_cognito.py +0 -0
  34. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_payload.py +0 -0
  35. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_upload.py +0 -0
  36. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/configuration_single_ev.json +0 -0
  37. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/meta_data.json +0 -0
  38. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/single_ev.csv +0 -0
  39. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +0 -0
  40. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +0 -0
  41. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/readme.md +0 -0
  42. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/tests/app_execution_test.py +0 -0
  43. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +0 -0
  44. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/integration_testing/tests/app_validation_test.py +0 -0
  45. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +0 -0
  46. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -0
  47. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/nca_resources/nca_executions.py +0 -0
  48. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/nca_resources/nca_login.py +0 -0
  49. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +0 -0
  50. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/utilities/environment_services.py +0 -0
  51. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +0 -0
  52. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -0
  53. {aplos_nca_saas_sdk-0.0.3 → aplos_nca_saas_sdk-0.0.5}/tests/__init__.py +0 -0
@@ -11,8 +11,7 @@
11
11
  ],
12
12
  "python.testing.cwd": "${workspaceFolder}",
13
13
  "python.analysis.extraPaths": [
14
- "${workspaceFolder}/src",
15
- "${workspaceFolder}/src/aplos_nca_saas_sdk",
14
+ "${workspaceFolder}/src",
16
15
  "${workspaceFolder}/tests",
17
16
  "${workspaceFolder}/devops",
18
17
  "${workspaceFolder}/devops/cdk",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aplos_nca_saas_sdk
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Aplos NCA SaaS SDK
5
5
  Project-URL: Homepage, https://aplosanalytics.com/
6
6
  Project-URL: Documentation, https://docs.aplosanalytics.com/
@@ -16,8 +16,9 @@ Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Classifier: Topic :: Software Development :: Libraries
18
18
  Requires-Python: >=3.10
19
- Requires-Dist: aws-lambda-powertools==2.38.1
19
+ Requires-Dist: aws-lambda-powertools>=3.3.0
20
20
  Requires-Dist: boto3==1.34.110
21
+ Requires-Dist: mypy-boto3-cognito-idp>=1.35.68
21
22
  Requires-Dist: pyjwt==2.9.0
22
23
  Requires-Dist: python-dotenv==1.0.1
23
24
  Requires-Dist: requests==2.31.0
@@ -4,8 +4,8 @@ import shutil
4
4
  import subprocess
5
5
  from pathlib import Path
6
6
  from typing import List
7
- import toml
8
7
 
8
+ import toml
9
9
  from aws_lambda_powertools import Logger
10
10
 
11
11
  logger = Logger()
@@ -35,8 +35,8 @@ def main():
35
35
 
36
36
  def run_local_clean_up():
37
37
  """run a local clean up and remove older items in the dist directory"""
38
- root = Path(__file__).parent.parent
39
- dist_dir = os.path.join(root, "dist")
38
+ project_root = Path(__file__).parents[2]
39
+ dist_dir = os.path.join(project_root, "dist")
40
40
  if os.path.exists(dist_dir):
41
41
  # clear it out
42
42
  shutil.rmtree(dist_dir)
@@ -26,7 +26,7 @@ keywords = [
26
26
  "Clinical Trials"
27
27
  ]
28
28
 
29
- version = "0.0.3"
29
+ version = "0.0.5"
30
30
  authors = [
31
31
  { name="Eric Wilson", email="eric.wilson@aplosanalytics.com" }
32
32
  ]
@@ -46,11 +46,12 @@ classifiers = [
46
46
  ]
47
47
 
48
48
  dependencies = [
49
- "aws-lambda-powertools==2.38.1",
49
+ "aws-lambda-powertools>=3.3.0",
50
50
  "requests==2.31.0",
51
51
  "boto3==1.34.110",
52
52
  "python-dotenv==1.0.1",
53
- "PyJWT==2.9.0"
53
+ "PyJWT==2.9.0",
54
+ "mypy_boto3_cognito_idp>=1.35.68"
54
55
  ]
55
56
 
56
57
  [project.urls]
@@ -0,0 +1,13 @@
1
+ from typing import Dict
2
+ from typing import Any
3
+
4
+
5
+ class ConfigBase:
6
+ """Base Configuration Class"""
7
+
8
+ def __init__(self, enabled: bool = True):
9
+ self.enabled: bool = enabled
10
+
11
+ def load(self, test_config: Dict[str, Any]):
12
+ """Load the configuration from a dictionary"""
13
+ self.enabled = test_config.get("enabled", True)
@@ -0,0 +1,60 @@
1
+ """
2
+ Copyright 2024 Aplos Analytics
3
+ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
+ Property of Aplos Analytics, Utah, USA
5
+ """
6
+
7
+ from typing import List, Dict, Any
8
+ from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
9
+
10
+
11
+ class ApplicationDomain(ConfigBase):
12
+ """
13
+ Application Domain: Defines the domains that the application configuration tests will check against
14
+
15
+ """
16
+
17
+ def __init__(self):
18
+ super().__init__()
19
+ self.__domain: str | None = None
20
+
21
+ @property
22
+ def domain(self) -> str:
23
+ """The domain to validate"""
24
+ if self.__domain is None:
25
+ raise RuntimeError("Domain is not set")
26
+ return self.__domain
27
+
28
+ @domain.setter
29
+ def domain(self, value: str):
30
+ self.__domain = value
31
+
32
+
33
+ class ApplicationSettings:
34
+ """
35
+ Application Settings: Defines the domains that the application settings (configuration endpoint) tests will check against
36
+
37
+ """
38
+
39
+ def __init__(self):
40
+ self.__domains: List[ApplicationDomain] = []
41
+
42
+ @property
43
+ def domains(self) -> List[ApplicationDomain]:
44
+ return self.__domains
45
+
46
+ @domains.setter
47
+ def domains(self, value: List[ApplicationDomain]):
48
+ self.__domains = value
49
+
50
+ def load(self, test_config: Dict[str, Any]):
51
+ """Load the domains from the config"""
52
+ domains: List[Dict[str, Any]] = test_config.get("domains", [])
53
+
54
+ domain: Dict[str, Any]
55
+ for domain in domains:
56
+ app_domain = ApplicationDomain()
57
+ app_domain.domain = domain.get("domain", None)
58
+ app_domain.enabled = bool(domain.get("enabled", True))
59
+
60
+ self.__domains.append(app_domain)
@@ -0,0 +1,105 @@
1
+ {
2
+ "application_config_test": {
3
+ "purpose": "Tests the application configuration endpoints",
4
+ "domains": [
5
+ {
6
+ "domain": "api.example.com",
7
+ "expected_results" : {
8
+ "status_code": 200
9
+ },
10
+ "enabled": true
11
+ },
12
+ {
13
+ "domain": "XXXXXXXXXXXXXXXXXXXXX",
14
+ "expected_results" : {
15
+ "status_code": 403
16
+ },
17
+ "enabled": false
18
+ }
19
+ ]
20
+ },
21
+ "login_test": {
22
+ "purpose": "Tests the login endpoints",
23
+ "logins": [
24
+ {
25
+ "username": "foo",
26
+ "password": "barr",
27
+ "domain": "api.example.com",
28
+ "roles": []
29
+
30
+ },
31
+ {
32
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
33
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
34
+ "domain": "XXXXXXXXXXXXXXXXXXXXX",
35
+ "roles": [
36
+ "XXXXXXXXXXXXXXXXXXXXX"
37
+ ],
38
+ "enabled" : false,
39
+ "expected_results" : {
40
+ "exception": "InvalidCredentialsException"
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "file_upload_test": {
46
+ "purpose": "Tests the file upload endpoints.",
47
+ "notes": "a file can be on the local drive or pulled from a public https source.",
48
+ "login": {
49
+ "purpose": "optional: if present this login is used, unless a specific login is defined for the test",
50
+ "username": "foo",
51
+ "password": "bar",
52
+ "domain": "api.example.com"
53
+ },
54
+ "files": [
55
+ {
56
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
57
+ "expected_results" : {
58
+ "status_code": 200
59
+ }
60
+ },
61
+ {
62
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
63
+ "login" : {
64
+ "purpose": "optional: if present tests an upload for a specific user",
65
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
66
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
67
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
68
+ },
69
+ "expected_results" : {
70
+ "status_code": 403
71
+ }
72
+ }
73
+ ]
74
+ },
75
+ "analysis_execution_test": {
76
+ "purpose": "Tests the analysis execution endpoints.",
77
+ "login": {
78
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
79
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
80
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
81
+ },
82
+ "analyses": [
83
+ {
84
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
85
+ "meta": {},
86
+ "config": {},
87
+ "expected_results" : {
88
+ "status_code": 200
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ "validation_test": {
94
+ "purpose": "Tests the validation execution.",
95
+ "login": {
96
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
97
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
98
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
99
+ },
100
+ "expected_results": {
101
+ "status_code": 200
102
+ }
103
+ }
104
+
105
+ }
@@ -4,10 +4,11 @@ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
4
  Property of Aplos Analytics, Utah, USA
5
5
  """
6
6
 
7
- from typing import List, Optional
7
+ from typing import List, Optional, Dict, Any
8
+ from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
8
9
 
9
10
 
10
- class TestLogin:
11
+ class Login(ConfigBase):
11
12
  """
12
13
  Application Login: Defines the login that the application configuration tests will check against
13
14
 
@@ -18,10 +19,13 @@ class TestLogin:
18
19
  username: Optional[str] = None,
19
20
  passord: Optional[str] = None,
20
21
  domain: Optional[str] = None,
22
+ roles: Optional[List[str]] = None,
21
23
  ):
24
+ super().__init__()
22
25
  self.__username: Optional[str] = username
23
26
  self.__password: Optional[str] = passord
24
27
  self.__domain: Optional[str] = domain
28
+ self.__roles: List[str] = roles if roles is not None else []
25
29
 
26
30
  @property
27
31
  def username(self) -> str:
@@ -53,25 +57,49 @@ class TestLogin:
53
57
  def domain(self, value: str):
54
58
  self.__domain = value
55
59
 
60
+ @property
61
+ def roles(self) -> List[str]:
62
+ """A list of roles to check for"""
63
+ return self.__roles
64
+
65
+ @roles.setter
66
+ def roles(self, value: List[str] | None):
67
+ if value is None:
68
+ value = []
69
+ self.__roles = value
56
70
 
57
- class TestLogins:
71
+
72
+ class Logins(ConfigBase):
58
73
  """
59
74
  Application Logins: Defines the logins that the application configuration tests will check against
60
75
 
61
76
  """
62
77
 
63
78
  def __init__(self):
64
- self.__logins: List[TestLogin] = []
79
+ super().__init__()
80
+ self.__logins: List[Login] = []
65
81
 
66
82
  @property
67
- def list(self) -> List[TestLogin]:
83
+ def list(self) -> List[Login]:
68
84
  """List the logins"""
69
85
  return self.__logins
70
86
 
71
- def add(self, *, username: str, password: str, domain: str):
87
+ def add(self, *, username: str, password: str, domain: str, enabled: bool = True):
72
88
  """Add a loging"""
73
- login = TestLogin()
89
+ login = Login()
74
90
  login.username = username
75
91
  login.password = password
76
92
  login.domain = domain
93
+ login.enabled = enabled
77
94
  self.__logins.append(login)
95
+
96
+ def load(self, test_config: Dict[str, Any]):
97
+ """Load the logins from a list of dictionaries"""
98
+ self.enabled = bool(test_config.get("enabled", True))
99
+ logins: List[Dict[str, str]] = test_config.get("logins", [])
100
+ for login in logins:
101
+ self.add(
102
+ username=login["username"],
103
+ password=login["password"],
104
+ domain=login["domain"],
105
+ )
@@ -6,7 +6,9 @@ Property of Aplos Analytics, Utah, USA
6
6
 
7
7
  from typing import Dict, Any, List
8
8
 
9
- from aplos_nca_saas_sdk.integration_testing.configs.config import TestConfiguration
9
+ from aplos_nca_saas_sdk.integration_testing.integration_test_configurations import (
10
+ TestConfiguration,
11
+ )
10
12
  from aplos_nca_saas_sdk.integration_testing.integration_test_response import (
11
13
  IntegrationTestResponse,
12
14
  )
@@ -0,0 +1,38 @@
1
+ """
2
+ Copyright 2024 Aplos Analytics
3
+ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
+ Property of Aplos Analytics, Utah, USA
5
+ """
6
+
7
+ import json
8
+ from typing import Any, Dict
9
+ from aplos_nca_saas_sdk.integration_testing.configs.app_settings import (
10
+ ApplicationSettings,
11
+ )
12
+ from aplos_nca_saas_sdk.integration_testing.configs.login import Logins
13
+
14
+
15
+ class TestConfiguration:
16
+ """
17
+ Testing Suite Configuration: Provides a way to define the testing configuration for the Aplos Analytics SaaS SDK
18
+
19
+ """
20
+
21
+ def __init__(self):
22
+ self.app_config: ApplicationSettings = ApplicationSettings()
23
+ self.logins: Logins = Logins()
24
+
25
+ def load(self, file_path: str):
26
+ """
27
+ Loads the configuration from a file
28
+
29
+ :param file_path: The path to the configuration file
30
+ :return: None
31
+ """
32
+
33
+ config: Dict[str, Any] = {}
34
+ with open(file_path, "r", encoding="utf-8") as f:
35
+ config = json.load(f)
36
+
37
+ self.logins.load(config.get("login_test", {}))
38
+ self.app_config.load(config.get("application_config_test", {}))
@@ -6,13 +6,18 @@ Property of Aplos Analytics, Utah, USA
6
6
 
7
7
  from typing import List, Dict, Any
8
8
  from datetime import datetime, UTC
9
+ from aws_lambda_powertools import Logger
9
10
  from aplos_nca_saas_sdk.integration_testing.integration_test_factory import (
10
11
  IntegrationTestFactory,
11
12
  )
12
13
  from aplos_nca_saas_sdk.integration_testing.integration_test_base import (
13
14
  IntegrationTestBase,
14
15
  )
15
- from aplos_nca_saas_sdk.integration_testing.configs.config import TestConfiguration
16
+ from aplos_nca_saas_sdk.integration_testing.integration_test_configurations import (
17
+ TestConfiguration,
18
+ )
19
+
20
+ logger = Logger(service="IntegrationTestSuite")
16
21
 
17
22
 
18
23
  class IntegrationTestSuite:
@@ -22,6 +27,7 @@ class IntegrationTestSuite:
22
27
  self.test_results: List[Dict[str, Any]] = []
23
28
  self.verbose: bool = False
24
29
  self.raise_on_failure: bool = False
30
+ self.fail_fast: bool = False
25
31
 
26
32
  def test(self, test_config: TestConfiguration) -> bool:
27
33
  """Run a full suite of integration tests"""
@@ -41,8 +47,8 @@ class IntegrationTestSuite:
41
47
  "start_time_utc": datetime.now(UTC),
42
48
  "end_time_utc": None,
43
49
  }
44
- if self.verbose:
45
- print(f"Running test class {test.name}")
50
+
51
+ logger.info(f"Running test class {test.name}")
46
52
  try:
47
53
  success = test.test()
48
54
  test_result["success"] = success
@@ -50,15 +56,18 @@ class IntegrationTestSuite:
50
56
  except Exception as e: # pylint: disable=broad-except
51
57
  test_result["success"] = False
52
58
  test_result["error"] = str(e)
59
+ if self.fail_fast:
60
+ # just break and let the failure routine handle it
61
+ break
53
62
 
54
63
  test_result["end_time_utc"] = datetime.now(UTC)
55
64
  self.test_results.append(test_result)
56
65
 
57
- if self.verbose:
58
- if test_result["success"]:
59
- print(f"Test {test.name} succeeded")
60
- else:
61
- print(f"Test {test.name} failed with error {test_result['error']}")
66
+ if test_result["success"]:
67
+ logger.info(f"Test {test.name} succeeded")
68
+ logger.debug(test_result)
69
+ else:
70
+ logger.error(test_result)
62
71
  # find the failures
63
72
  failures = [test for test in self.test_results if not test["success"]]
64
73
  self.__print_results(start_time, failures)
@@ -67,7 +76,7 @@ class IntegrationTestSuite:
67
76
 
68
77
  if self.raise_on_failure and len(failures) > 0:
69
78
  count = len(failures)
70
- print(f"{count} tests failed. Raising exception.")
79
+ logger.error(f"{count} tests failed. Raising exception.")
71
80
  raise RuntimeError(f"{count} tests failed")
72
81
 
73
82
  return len(failures) == 0
@@ -5,11 +5,14 @@ Property of Aplos Analytics, Utah, USA
5
5
  """
6
6
 
7
7
  import os
8
+ from pathlib import Path
8
9
  from aplos_nca_saas_sdk.utilities.environment_services import EnvironmentServices
9
10
  from aplos_nca_saas_sdk.integration_testing.integration_test_suite import (
10
11
  IntegrationTestSuite,
11
12
  )
12
- from aplos_nca_saas_sdk.integration_testing.configs.config import TestConfiguration
13
+ from aplos_nca_saas_sdk.integration_testing.integration_test_configurations import (
14
+ TestConfiguration,
15
+ )
13
16
 
14
17
 
15
18
  def main():
@@ -23,6 +26,21 @@ def main():
23
26
 
24
27
  its: IntegrationTestSuite = IntegrationTestSuite()
25
28
  config: TestConfiguration = TestConfiguration()
29
+
30
+ # normally we'd pull a test configuration file from Secrets Manager, Parameter Store, or some other secure location
31
+ # here we're going to pull the sample file and then override some it's values.
32
+ config_file = os.path.join(Path(__file__).parent, "configs", "config_sample.json")
33
+ # load it so we can see what it looks like
34
+ config.load(file_path=config_file)
35
+
36
+ # override the configuration
37
+ override_config(config)
38
+
39
+ its.test(test_config=config)
40
+
41
+
42
+ def override_config(config: TestConfiguration):
43
+ """Override the configuration for the tests"""
26
44
  username = os.getenv("TEST_USERNAME")
27
45
  password = os.getenv("TEST_PASSWORD")
28
46
  domain = os.getenv("TEST_DOMAIN")
@@ -32,10 +50,11 @@ def main():
32
50
  "TEST_USERNAME, TEST_PASSWORD, and TEST_DOMAIN must be set in the environment"
33
51
  )
34
52
 
53
+ config.logins.list.clear()
35
54
  config.logins.add(username=username, password=password, domain=domain)
36
- config.app_config.domains.append(domain)
37
55
 
38
- its.test(test_config=config)
56
+ config.app_config.domains.clear()
57
+ config.app_config.domains.append(domain)
39
58
 
40
59
 
41
60
  if __name__ == "__main__":
@@ -26,11 +26,11 @@ class TestAppConfiguration(IntegrationTestBase):
26
26
  """Test loading the application configuration"""
27
27
 
28
28
  self.results.clear()
29
- for domain in self.config.app_config.domains:
30
- config: NCAAppConfiguration = NCAAppConfiguration(domain)
29
+ for domain_config in self.config.app_config.domains:
30
+ config: NCAAppConfiguration = NCAAppConfiguration(domain_config.domain)
31
31
 
32
32
  test_response: IntegrationTestResponse = IntegrationTestResponse()
33
- test_response.meta = {"domain": domain}
33
+ test_response.meta = {"domain": domain_config}
34
34
  try:
35
35
  response = config.get()
36
36
  test_response.response = response
@@ -1,4 +1,4 @@
1
1
  # Aplos NCA SaaS SDK Version File
2
2
  # This is automatically generated during the build process.
3
3
  # DO NOT UPDATE IT DIRECTLY. IT WILL BE OVERWRITTEN.
4
- __version__ = '0.0.3'
4
+ __version__ = '0.0.5'
@@ -1,25 +0,0 @@
1
- """
2
- Copyright 2024 Aplos Analytics
3
- All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
- Property of Aplos Analytics, Utah, USA
5
- """
6
-
7
- from typing import List
8
-
9
-
10
- class TestApplicationConfiguration:
11
- """
12
- Application Configuration: Defines the domains that the application configuration tests will check against
13
-
14
- """
15
-
16
- def __init__(self):
17
- self.__domains: List[str] = []
18
-
19
- @property
20
- def domains(self) -> List[str]:
21
- return self.__domains
22
-
23
- @domains.setter
24
- def domains(self, value: List[str]):
25
- self.__domains = value
@@ -1,21 +0,0 @@
1
- """
2
- Copyright 2024 Aplos Analytics
3
- All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
- Property of Aplos Analytics, Utah, USA
5
- """
6
-
7
- from aplos_nca_saas_sdk.integration_testing.configs.app_config import (
8
- TestApplicationConfiguration,
9
- )
10
- from aplos_nca_saas_sdk.integration_testing.configs.login import TestLogins
11
-
12
-
13
- class TestConfiguration:
14
- """
15
- Testing Suite Configuration: Provides a way to define the testing configuration for the Aplos Analytics SaaS SDK
16
-
17
- """
18
-
19
- def __init__(self):
20
- self.app_config: TestApplicationConfiguration = TestApplicationConfiguration()
21
- self.logins: TestLogins = TestLogins()