Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup pytest output in GitHub actions #464

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ auth0:
domain: ENC[AES256_GCM,data:aEi/GvnxpyGsvinhZ5sXXto=,iv:SR6sgQronhovtuUpQnSuIO2KFo9eTSP9tgFqg+QBJ8I=,tag:6yzNIPmFEWilI1qajTH1WQ==,type:str]
client_id: ENC[AES256_GCM,data:aHw7KJCg4Hn2RiLIiONQXnc48/JFsCCnW0WFVLtCFgM=,iv:FFxe1kNtBh5ljroqCTW3wicQzyDszSCSyYx4Boe2Dns=,tag:a/m2QDTrcKpurKq0IZPjOw==,type:str]
client_secret: ENC[AES256_GCM,data:B+fw9jZUc2b0Mb9CD/Pas+aZLPd3Rp1GI6Wrq0wXYcE5HvMEOXhXOqzl9nEKhbR/cVAh5YZt+xlI8G2zOraWbQ==,iv:nDIxzcuQ5Noxp7HyYsL02hBRDLi9An5MN8IEdLnLffA=,tag:T4GgBUkzfSV5UC8RX8yT2g==,type:str]
secret_key: ENC[AES256_GCM,data:qW7+NtYj3MB6eMjTnMJQ36stcKONkHzKYkn9sflbJuwX3fwYGIvDQg2Rf2LDWAj8z40NC/zdabMaFGiEredo5Q==,iv:KOpUcN9jSpmwIYuUqOidhoapdo5zagw4tXhQvmVfPDU=,tag:vwUI0Z3OIivLRZ5W8DjZRA==,type:str]
secret_key: ENC[AES256_GCM,data:ZT5kb64zUJIEKhUQSKgCRF8HcEnvK59KCtVs6TEO+O3S5qWBJIJY9kivlYU8a93XRN9cxIi9YlG4EfLoFR5JUw==,iv:V5OKGcKfG6s4EKdonrosvFJPltujSp5z4SZ8th9SkYs=,tag:jqQcK4+HO+i8SLerABYxeQ==,type:str]
sops:
kms: []
gcp_kms:
Expand All @@ -12,8 +12,8 @@ sops:
azure_kv: []
hc_vault: []
age: []
lastmodified: "2021-04-20T12:00:51Z"
mac: ENC[AES256_GCM,data:2DN2eV24vFWm3Zk5YAnYDZ7oPoGwJKKKByIkQQO5Z879nBbFrJKAfsF+WnVA3BfuuFEBW/iSYP+933m7O4yRfLH4P07/HUYasq7g9pXHxgZdQZzdVb5QiGQmYGYnvvDjcJFGLJxp/c/v59GkkIRvjtU9QZbb7fd4KnRJV4keRXw=,iv:wa9s1Sur7/KCJlsMWnQtDMIL7WPX0Zup96ncj4/vdMM=,tag:KwYctS7BtHpJIbg6x8WnDQ==,type:str]
lastmodified: "2021-06-11T06:36:56Z"
mac: ENC[AES256_GCM,data:oW0k09Gd65XK0OxRcX9jPaDMatFPrE42A6rdIHvKNQBmM2MY+VECKLbDzci1Ob9VZsp91ss0psn0im28z9G/Fjf6adRwXjtnI7k5KkEwkwivxpnk9RX+ZyPkFn4ccnhbHEciRU4NVS1upFJLCGDs9EBZ6FTXzMEx5aL2jUlLXYA=,iv:oaIR4rwUgcLpEFo19kziEuNJwf407NHPQVsM2pPRvxY=,tag:zozw57Qc1CYVj6TLkiyPlQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.1
27 changes: 18 additions & 9 deletions deployer/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import hmac
import json
import os
import random
import sys
import subprocess
import tempfile
from contextlib import contextmanager
from contextlib import contextmanager, redirect_stderr, redirect_stdout
from textwrap import dedent

import pytest
Expand Down Expand Up @@ -366,11 +366,20 @@ def deploy(self, auth_provider, secret_key, skip_hub_health_test=False):

hub_url = f'https://{self.spec["domain"]}'

exit_code = pytest.main([
"-v", "deployer/tests",
"--hub-url", hub_url,
"--api-token", service_api_token,
"--hub-type", self.spec['template']
])
# On failure, pytest prints out params to the test that failed.
# This can contain sensitive info - so we hide stderr
# FIXME: Try to be more granular here?
print("Running hub health check...")
with open(os.devnull, 'w') as dn, redirect_stderr(dn), redirect_stdout(dn):
exit_code = pytest.main([
"-q",
"deployer/tests",
"--hub-url", hub_url,
"--api-token", service_api_token,
"--hub-type", self.spec['template']
])
if exit_code != 0:
raise(RuntimeError)
print("Health check failed!", file=sys.stderr)
sys.exit(exit_code)
else:
print("Helath check succeeded!")