gitea
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not gitea’s official test suite, and the gitea project is not affiliated with atago.
Summary #
1 suite · 3 scenarios
Contents #
- gitea (self-hosted git service) — 3 scenarios
gitea (self-hosted git service) #
Source: test/e2e/thirdparty/gitea/gitea.atago.yaml
Scenario: the binary reports its version #
When #
gitea --version
Then #
- exit code is
0 - stdout matches
/gitea version [0-9]+\.[0-9]+\.[0-9]+/
Scenario: the server boots from an authored app.ini and reports healthy #
Given #
- Background service
giteais started:gitea web --config app.ini. - Fixture file
app.iniis created.
Inputs #
Fixture app.ini:
[server]
HTTP_ADDR = 127.0.0.1
HTTP_PORT = 18140
ROOT_URL = http://127.0.0.1:18140/
DISABLE_SSH = true
OFFLINE_MODE = true
[database]
DB_TYPE = sqlite3
PATH = data/gitea.db
[security]
INSTALL_LOCK = true
[log]
MODE = console
LEVEL = Warn
[repository]
ROOT = data/repos
… (truncated, 3 more lines)
When #
# HTTP GET /api/healthz
# HTTP GET /api/v1/version
Then #
- after
HTTP GET /api/healthz:- HTTP status is
200
- HTTP status is
- after
HTTP GET /api/v1/version:- HTTP status is
200 - body at
$.versionmatches/^[0-9]+\.[0-9]+\.[0-9]+/
- HTTP status is
Scenario: admin CLI, REST API, and a real git clone interoperate #
Given #
- Background service
giteais started:gitea web --config app.ini. - Fixture file
app.iniis created.
Inputs #
Fixture app.ini:
[server]
HTTP_ADDR = 127.0.0.1
HTTP_PORT = 18141
ROOT_URL = http://127.0.0.1:18141/
DISABLE_SSH = true
OFFLINE_MODE = true
[database]
DB_TYPE = sqlite3
PATH = data/gitea.db
[security]
INSTALL_LOCK = true
[log]
MODE = console
LEVEL = Warn
[repository]
ROOT = data/repos
… (truncated, 3 more lines)
When #
# HTTP GET /api/healthz
gitea --config app.ini admin user create --username atago --password atago-e2e-pass1 --email atago@example.com --admin --must-change-password=false
gitea --config app.ini admin user generate-access-token --username atago --token-name e2e --scopes all --raw
# capture ${token} from stdout
# HTTP POST /api/v1/user/repos
# HTTP POST /api/v1/repos/atago/demo/contents/hello.txt
# HTTP POST /api/v1/repos/atago/demo/issues
# HTTP GET /api/v1/repos/atago/demo/issues/1
git clone http://atago:atago-e2e-pass1@127.0.0.1:18141/atago/demo.git checkout
Then #
- after
gitea --config app.ini admin user create --username atago --password atago-e2e-pass1 --email atago@example.com --admin --must-change-password=false:- exit code is
0 - stdout contains
successfully created
- exit code is
- after
gitea --config app.ini admin user generate-access-token --username atago --token-name e2e --scopes all --raw:- exit code is
0 - stdout matches
/^[0-9a-f]{40}\s*$/
- exit code is
- after
HTTP POST /api/v1/user/repos:- HTTP status is
201 - body at
$.nameequalsdemo - body at
$.owner.loginequalsatago
- HTTP status is
- after
HTTP POST /api/v1/repos/atago/demo/contents/hello.txt:- HTTP status is
201 - body at
$.content.pathequalshello.txt
- HTTP status is
- after
HTTP POST /api/v1/repos/atago/demo/issues:- HTTP status is
201 - body at
$.numberequals1
- HTTP status is
- after
HTTP GET /api/v1/repos/atago/demo/issues/1:- HTTP status is
200 - body at
$.stateequalsopen
- HTTP status is
- after
git clone http://atago:atago-e2e-pass1@127.0.0.1:18141/atago/demo.git checkout:- exit code is
0 - file
checkout/hello.txtcontainshello from atago - dir
checkoutcontainsREADME.md, containshello.txt
- exit code is