From 76426baa2aea1159659ab20711b886ee2f2c081a Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 22 Nov 2023 15:52:59 +0000 Subject: [PATCH] chore(ci): create traces dir (#5327) --- .github/workflows/console-test-run.yml | 2 +- apps/trading/e2e/conftest.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index aebb1b27b..2e5740bca 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -215,7 +215,7 @@ jobs: if: always() with: name: playwright-trace - path: ./traces/ + path: apps/trading/e2e/traces/ retention-days: 15 #---------------------------------------------- # ----- upload logs ----- diff --git a/apps/trading/e2e/conftest.py b/apps/trading/e2e/conftest.py index 1483cb135..dec6bc5dd 100644 --- a/apps/trading/e2e/conftest.py +++ b/apps/trading/e2e/conftest.py @@ -136,8 +136,11 @@ def init_page(vega: VegaServiceNull, browser: Browser, request: pytest.FixtureRe page.add_init_script(script=window_env) yield page finally: - if not os.path.exists("traces"): - os.makedirs("traces") + try: + if not os.path.exists("apps/trading/e2e/traces"): + os.makedirs("apps/trading/e2e/traces") + except OSError as e: + print(f"Failed to create directory '{'apps/trading/e2e/traces'}': {e}") # Check whether this test failed or passed outcome = request.config.cache.get(request.node.nodeid, None)