From 894d15918b735e5f88442e61aa3c118a8133094c Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Thu, 25 Apr 2024 12:45:08 +0100 Subject: [PATCH] Fix BASE_URL construction in Config.ts and SignUp.test.ts --- E2E/Config.ts | 2 +- E2E/Tests/Home/SignUp.test.ts | 4 +++- HelmChart/Public/oneuptime/templates/e2e-cron.yml | 8 ++++++-- HelmChart/Public/oneuptime/values.yaml | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/E2E/Config.ts b/E2E/Config.ts index 6506645e32..476c8953ba 100644 --- a/E2E/Config.ts +++ b/E2E/Config.ts @@ -12,4 +12,4 @@ export const HOST: string = env('HOST') || 'localhost'; export const HTTP_PROTOCOL: Protocol = env('HTTP_PROTOCOL') === 'https' ? Protocol.HTTPS : Protocol.HTTP; -export const BASE_URL: URL = URL.fromString(`${HTTP_PROTOCOL}://${HOST}`); +export const BASE_URL: URL = URL.fromString(`${HTTP_PROTOCOL}${HOST}`); diff --git a/E2E/Tests/Home/SignUp.test.ts b/E2E/Tests/Home/SignUp.test.ts index 00260dbd92..82baf52295 100644 --- a/E2E/Tests/Home/SignUp.test.ts +++ b/E2E/Tests/Home/SignUp.test.ts @@ -6,5 +6,7 @@ test.beforeEach(async ({ page }: { page: Page }) => { }); test('sign up button', async ({ page }: { page: Page }) => { await page.getByTestId('Sign-up').click(); - await expect(page).toHaveURL(BASE_URL + '/accounts/register'); + await expect(page).toHaveURL( + BASE_URL.addRoute('/accounts/register').toString() + ); }); diff --git a/HelmChart/Public/oneuptime/templates/e2e-cron.yml b/HelmChart/Public/oneuptime/templates/e2e-cron.yml index 84a41d176c..9112a73c17 100644 --- a/HelmChart/Public/oneuptime/templates/e2e-cron.yml +++ b/HelmChart/Public/oneuptime/templates/e2e-cron.yml @@ -1,4 +1,6 @@ +{{- if $.Values.cronJobs.e2e.enabled }} + apiVersion: batch/v1 kind: CronJob metadata: @@ -7,7 +9,7 @@ metadata: labels: appname: oneuptime spec: - schedule: "*/30 * * * *" # At every 30 minute. + schedule: "*/5 * * * *" # At every 30 minute. jobTemplate: spec: template: @@ -17,4 +19,6 @@ spec: image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "e2e" $.Values.image.tag }} env: {{- include "oneuptime.env.common" . | nindent 14 }} - restartPolicy: Never \ No newline at end of file + restartPolicy: Never + +{{- end }} \ No newline at end of file diff --git a/HelmChart/Public/oneuptime/values.yaml b/HelmChart/Public/oneuptime/values.yaml index 1efed04b1f..c05cf61ef0 100644 --- a/HelmChart/Public/oneuptime/values.yaml +++ b/HelmChart/Public/oneuptime/values.yaml @@ -195,4 +195,6 @@ logLevel: ERROR cronJobs: cleanup: enabled: false + e2e: + enabled: false \ No newline at end of file