-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add initial playwright config #18442
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f69f99f
Add initial playwright config
kdumontnu 418867b
Simplify Makefile
kdumontnu 682675b
Simplify Makefile
kdumontnu 9a8c600
Use correct config files
kdumontnu 9b04f90
Update playwright settings
kdumontnu a6e660a
Fix package-lock file
kdumontnu 6d01598
Don't use test logger for e2e tests
kdumontnu 5f998fb
fix frontend lint
kdumontnu a63ba41
Allow passing TEST_LOGGER variable
kdumontnu 0a41325
Init postgres database
kdumontnu dda3d89
use standard gitea env variables
kdumontnu 22aa0ed
Update playwright
kdumontnu b08bfb5
update drone
kdumontnu 282397f
Move empty env var to commands
kdumontnu 0236676
Cleanup
kdumontnu f9aab1f
Merge branch 'main' into kd/ci-playwright
kdumontnu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,3 +118,7 @@ prime/ | |
|
||
# Manpage | ||
/man | ||
test-results/ | ||
|
||
# E2E | ||
tools/e2e/reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,10 @@ ifeq ($(filter $(TAGS_SPLIT),bindata),bindata) | |
GO_SOURCES += $(BINDATA_DEST) | ||
endif | ||
|
||
ifneq ($(NO_DEPS_PLAYWRIGHT),1) | ||
PLAYWRIGHT_FLAGS += --with-deps | ||
endif | ||
|
||
SWAGGER_SPEC := templates/swagger/v1_json.tmpl | ||
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|g | ||
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g | ||
|
@@ -183,6 +187,7 @@ help: | |
@echo " - test test everything" | ||
@echo " - test-frontend test frontend files" | ||
@echo " - test-backend test backend files" | ||
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright" | ||
@echo " - webpack build webpack files" | ||
@echo " - svg build svg files" | ||
@echo " - fomantic build fomantic files" | ||
|
@@ -390,6 +395,7 @@ gomod-check: tidy | |
|
||
generate-ini-sqlite: | ||
sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ | ||
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ | ||
integrations/sqlite.ini.tmpl > integrations/sqlite.ini | ||
|
||
.PHONY: test-sqlite | ||
|
@@ -416,6 +422,7 @@ generate-ini-mysql: | |
-e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \ | ||
-e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \ | ||
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ | ||
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ | ||
integrations/mysql.ini.tmpl > integrations/mysql.ini | ||
|
||
.PHONY: test-mysql | ||
|
@@ -437,6 +444,7 @@ generate-ini-mysql8: | |
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \ | ||
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \ | ||
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ | ||
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ | ||
integrations/mysql8.ini.tmpl > integrations/mysql8.ini | ||
|
||
.PHONY: test-mysql8 | ||
|
@@ -459,6 +467,7 @@ generate-ini-pgsql: | |
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \ | ||
-e 's|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \ | ||
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ | ||
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ | ||
integrations/pgsql.ini.tmpl > integrations/pgsql.ini | ||
|
||
.PHONY: test-pgsql | ||
|
@@ -480,6 +489,7 @@ generate-ini-mssql: | |
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \ | ||
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \ | ||
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ | ||
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ | ||
integrations/mssql.ini.tmpl > integrations/mssql.ini | ||
|
||
.PHONY: test-mssql | ||
|
@@ -495,6 +505,60 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test gen | |
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test -test.failfast | ||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.individual.mssql.test -test.failfast | ||
|
||
.PHONY: test-e2e% | ||
# Use only file logging for end-to-end tests | ||
test-e2e%: TEST_LOGGER ?= file | ||
|
||
.PHONY: test-e2e | ||
test-e2e: test-e2e-sqlite | ||
|
||
.PHONY: test-e2e\#% | ||
test-e2e\#%: test-e2e-sqlite\#% | ||
# Kind of a hack to get makefile to accept passing arguement | ||
true | ||
|
||
.PHONY: test-e2e-sqlite | ||
test-e2e-sqlite: TAGS+=sqlite sqlite_unlock_notify | ||
test-e2e-sqlite: build generate-ini-sqlite | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_ROOT=$(CURDIR) GITEA_URL="http://localhost:3003" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=integrations/sqlite.ini ./tools/e2e/run_e2e.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to override the |
||
|
||
.PHONY: test-e2e-sqlite\#% | ||
test-e2e-sqlite\#%: TAGS+=sqlite sqlite_unlock_notify | ||
test-e2e-sqlite\#%: build generate-ini-sqlite | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_URL="http://localhost:3003" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/sqlite.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-mysql8 | ||
test-e2e-mysql8: build generate-ini-mysql8 | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_URL="http://localhost:3004" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/mysql8.ini ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-mysql8\#% | ||
test-e2e-mysql8\#%: build generate-ini-mysql8 | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_URL="http://localhost:3004" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/mysql8.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-pgsql | ||
test-e2e-pgsql: build generate-ini-pgsql | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_URL="http://localhost:3002" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/pgsql.ini ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-pgsql\#% | ||
test-e2e-pgsql\#%: build generate-ini-pgsql | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_URL="http://localhost:3002" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/pgsql.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-mssql | ||
test-e2e-mssql: build generate-ini-mssql | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_ROOT=$(CURDIR) GITEA_URL="http://localhost:3003" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/mssql.ini ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: test-e2e-mssql\#% | ||
test-e2e-mssql\#%: build generate-ini-mssql | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
GITEA_ROOT=$(CURDIR) GITEA_URL="http://localhost:3003" GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=$(CURDIR)/integrations/mssql.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh | ||
|
||
.PHONY: bench-sqlite | ||
bench-sqlite: integrations.sqlite.test generate-ini-sqlite | ||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.