Skip to content

Commit

Permalink
#703 local schema file only for harness-test
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Aug 23, 2023
1 parent 82696dc commit 6c52985
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def get_user_password(main_user: ApplicationUser):
def get_app_environment(app_config: ApplicationHarnessConfig, app_domain, use_local_env=True):
my_env = os.environ.copy() if use_local_env else {}
my_env["APP_URL"] = app_domain
schema_file = f"applications/{app_config.name}/api/openapi.yaml"
if os.path.exists(schema_file):
my_env["APP_SCHEMA_FILE"] = schema_file


if app_config.accounts and app_config.accounts.users:
main_user: ApplicationUser = app_config.accounts.users[0]
Expand Down
6 changes: 6 additions & 0 deletions tools/cloudharness-test/cloudharness_test/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def run_api_tests(root_paths, helm_values: HarnessMainConfig, base_domain, inclu

app_env = get_app_environment(app_config, app_domain)

schema_file = f"applications/{app_config.name}/api/openapi.yaml"

for path in root_paths:
if os.path.exists(os.path.join(path, schema_file)):
app_env["APP_SCHEMA_FILE"] = schema_file

if api_config.autotest:
logging.info("Running auto api tests")
cmd = get_schemathesis_command(api_filename, app_config, app_domain)
Expand Down

0 comments on commit 6c52985

Please sign in to comment.