diff --git a/.github/workflows/test.server.yml b/.github/workflows/test.server.yml index 3859efa1..f026676f 100644 --- a/.github/workflows/test.server.yml +++ b/.github/workflows/test.server.yml @@ -34,6 +34,24 @@ jobs: - name: Run golangci-lint run: golangci-lint run ./... + - name: Create env file + working-directory: ./server/test/e2e + run: | + { + echo DB_HOST=${{ vars.DB_HOST }} + echo DB_PORT=${{ vars.DB_PORT }} + echo DB_USER=${{ vars.DB_USER }} + echo DB_PASSWORD=${{ secrets.DB_PASSWORD }} + echo DB_NAME=${{ vars.DB_NAME }} + echo CORS_ALLOWED_ORIGIN=${{ vars.CORS_ALLOWED_ORIGIN }} + echo SERVER_PORT=${{ vars.SERVER_PORT }} + echo SERVER_CERT_PATH=${{ vars.SERVER_CERT_PATH }} + echo SERVER_KEY_PATH=${{ vars.SERVER_KEY_PATH }} + echo COOKIE_DOMAIN=${{ vars.COOKIE_DOMAIN }} + echo JWT_ACCESS_TOKEN_KEY=${{ secrets.JWT_ACCESS_TOKEN_KEY }} + echo JWT_REFRESH_TOKEN_KEY=${{ secrets.JWT_REFRESH_TOKEN_KEY }} + } >> .env + - name: Run tests with coverage run: go test ./... -coverprofile=coverage.out diff --git a/server/test/e2e/.env b/server/test/e2e/.env new file mode 100644 index 00000000..46c9e444 --- /dev/null +++ b/server/test/e2e/.env @@ -0,0 +1,13 @@ +DB_HOST=localhost +DB_PORT=5433 +DB_USER=root +DB_PASSWORD=root +DB_NAME=postgres +CORS_ALLOWED_ORIGIN=http://macbookpro.local:5173,http://localhost:5173 +SERVER_PORT=8081 +SSE_PORT=8081 +SERVER_CERT_PATH=/Users/christian/Code/crlssn/getstronger/.secrets/localhost.crt +SERVER_KEY_PATH=/Users/christian/Code/crlssn/getstronger/.secrets/localhost.key +COOKIE_DOMAIN= +JWT_ACCESS_TOKEN_KEY=access-key +JWT_REFRESH_TOKEN_KEY=refresh-key diff --git a/server/test/e2e/e2e_test.go b/server/test/e2e/e2e_test.go index 29ef9721..c0555248 100644 --- a/server/test/e2e/e2e_test.go +++ b/server/test/e2e/e2e_test.go @@ -26,7 +26,7 @@ import ( func TestE2E(t *testing.T) { t.Parallel() - if err := godotenv.Load("../../../.env"); err != nil { + if err := godotenv.Load(); err != nil { require.NoError(t, err) }