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

chore(e2e): simplify Cypress record key usage #29327

Merged
merged 12 commits into from
Jun 24, 2024
10 changes: 3 additions & 7 deletions scripts/cypress_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
XVFB_PRE_CMD = "xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' "
REPO = os.getenv("GITHUB_REPOSITORY") or "apache/superset"
GITHUB_EVENT_NAME = os.getenv("GITHUB_REPOSITORY") or "push"
CYPRESS_RECORD_KEY = os.getenv("CYPRESS_RECORD_KEY") or ""


def compute_hash(file_path: str) -> str:
Expand Down Expand Up @@ -55,18 +56,13 @@ def get_cypress_cmd(

if use_dashboard:
# Run using cypress.io service
cypress_key = os.getenv("CYPRESS_KEY")
command = f"echo {cypress_key} | base64 --decode"
cypress_record_key = (
subprocess.check_output(command, shell=True).decode("utf-8").strip()
)
os.environ["CYPRESS_RECORD_KEY"] = cypress_record_key
spec: str = "*/**/*"
cmd = (
f"{XVFB_PRE_CMD} "
f'{cypress_cmd} --spec "{spec}" --browser {browser} '
f"--record --group {group} --tag {REPO},{GITHUB_EVENT_NAME} "
f"--parallel --ci-build-id {build_id}"
f"--parallel --ci-build-id {build_id} "
f"--key {CYPRESS_RECORD_KEY}"
)
else:
# Run local, but split the execution
Expand Down
Loading