Skip to content

Commit f69f99f

Browse files
committed
Add initial playwright config
1 parent fd97c4e commit f69f99f

File tree

7 files changed

+5590
-2316
lines changed

7 files changed

+5590
-2316
lines changed

.drone.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,72 @@ steps:
498498
- name: deps
499499
path: /go
500500

501+
---
502+
kind: pipeline
503+
type: docker
504+
name: testing-e2e
505+
506+
platform:
507+
os: linux
508+
arch: amd64
509+
510+
#depends_on:
511+
# - testing-amd64
512+
# - testing-arm64
513+
514+
trigger:
515+
event:
516+
- push
517+
- tag
518+
- pull_request
519+
520+
services:
521+
- name: pgsql
522+
pull: default
523+
image: postgres:10
524+
environment:
525+
POSTGRES_DB: test
526+
POSTGRES_PASSWORD: postgres
527+
528+
steps:
529+
- name: fetch-tags
530+
image: docker:git
531+
commands:
532+
- git fetch --tags --force
533+
when:
534+
event:
535+
exclude:
536+
- pull_request
537+
538+
- name: tag-pre-condition
539+
pull: always
540+
image: drone/git
541+
commands:
542+
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
543+
544+
- name: build
545+
pull: always
546+
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
547+
commands:
548+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
549+
- make build
550+
environment:
551+
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
552+
GOSUMDB: sum.golang.org
553+
TAGS: bindata sqlite sqlite_unlock_notify
554+
555+
- name: test-e2e
556+
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
557+
commands:
558+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
559+
- timeout -s ABRT 40m make test-e2e-pgsql
560+
environment:
561+
GOPROXY: https://goproxy.cn
562+
TAGS: bindata
563+
USE_REPO_TEST_DIR: 1
564+
depends_on:
565+
- build
566+
501567
---
502568
kind: pipeline
503569
name: update_translations

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,5 @@ prime/
118118

119119
# Manpage
120120
/man
121+
test-results/
122+
playwright-report/

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ help:
183183
@echo " - test test everything"
184184
@echo " - test-frontend test frontend files"
185185
@echo " - test-backend test backend files"
186+
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
186187
@echo " - webpack build webpack files"
187188
@echo " - svg build svg files"
188189
@echo " - fomantic build fomantic files"
@@ -495,6 +496,26 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test gen
495496
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test -test.failfast
496497
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.individual.mssql.test -test.failfast
497498

499+
.PHONY: test-e2e
500+
test-e2e: test-e2e-pgsql
501+
502+
.PHONY: test-e2e\#%
503+
test-e2e\#%: test-e2e-pgsql\#%
504+
echo "Why do I need this?"
505+
506+
# Can I share the database with integration tests? Is it cleaned up between tests?
507+
.PHONY: test-e2e-pgsql
508+
test-e2e-pgsql: build generate-ini-pgsql
509+
npx playwright install --with-deps
510+
GITEA_ROOT="$(CURDIR)" ./$(EXECUTABLE) web -c integrations/pgsql.ini --quiet & \
511+
(wait $i && npx playwright test && killall gitea)
512+
513+
.PHONY: test-e2e-pgsql\#%
514+
test-e2e-pgsql\#%: build generate-ini-pgsql
515+
npx playwright install --with-deps
516+
GITEA_ROOT="$(CURDIR)" ./$(EXECUTABLE) web -c integrations/pgsql.ini --quiet & \
517+
(wait $i && npx playwright test $* && killall gitea)
518+
498519
.PHONY: bench-sqlite
499520
bench-sqlite: integrations.sqlite.test generate-ini-sqlite
500521
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .

0 commit comments

Comments
 (0)