Skip to content

Add initial playwright config #18442

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

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Init postgres database
  • Loading branch information
kdumontnu committed Jun 22, 2022
commit 0a4132554ff7ea612f69885d00676e34c8805af2
12 changes: 7 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,9 @@ services:
pull: default
image: postgres:10
environment:
POSTGRES_DB: test
POSTGRES_DB: testgitea
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'

steps:
- name: tag-pre-condition
Expand All @@ -535,17 +536,18 @@ steps:
image: mcr.microsoft.com/playwright:v1.18.1-focal
commands:
- curl -sL https://go.dev/dl/go1.17.6.linux-amd64.tar.gz -o go1.17.6.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz
- groupadd --gid 1001 gitea
- useradd -m --gid 1001 --uid 1001 gitea
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
- ./build/test-env-prepare.sh
- su gitea GOPROXY=$GOPROXY GOSUMDB=$GOSUMDB TAGS=$TAGS NO_DEPS_PLAYWRIGHT=$NO_DEPS_PLAYWRIGHT bash -c "export PATH=$PATH:/usr/local/go/bin && timeout -s ABRT 40m make test-e2e-pgsql"
- su gitea bash -c "export PATH=$PATH:/usr/local/go/bin && timeout -s ABRT 40m make test-e2e-pgsql"
environment:
GOPROXY: https://goproxy.cn
GOSUMDB: sum.golang.org
TAGS: bindata
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tag is for go build only in my mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated the summary. I'm actually building the binary before running e2e tests. Alternatively, I could throw an error "Build gitea before running e2e tests", but I like this better right now.

USE_REPO_TEST_DIR: 1
NO_DEPS_PLAYWRIGHT: 1
TEST_LOGGER: console,file
TEST_LOGGER: console,file # Debug
TEST_PGSQL_SCHEMA: ''
NPX_FLAGS: '--yes'

---
kind: pipeline
Expand Down
1 change: 1 addition & 0 deletions tools/e2e/run_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euo pipefail
[[ -z "${GITEA_CONF}" ]] && GiteaConfig='' || GiteaConfig="-C . -c ${GITEA_CONF}"

./${GITEA_EXECUTABLE:-gitea} ${GiteaConfig} --quiet web &
sleep 30
npx playwright test ${E2E_TESTS:-""}

trap 'kill $(jobs -p)' EXIT