Various fixes for CI and Makefile (#443)

update TestAdminCronTasks

fix Makefile

gitea cli comand to create a user changed

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/443
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: 6543 <6543@noreply.gitea.io>
Co-Committed-By: 6543 <6543@noreply.gitea.io>
This commit is contained in:
6543 2020-11-09 08:58:30 +08:00 committed by Lunny Xiao
parent cb66dbb487
commit 8c9d3985b4
3 changed files with 6 additions and 6 deletions

View file

@ -29,7 +29,7 @@ steps:
- echo "[server]" >> /tmp/conf/app.ini - echo "[server]" >> /tmp/conf/app.ini
- echo "ROOT_URL = http://gitea:3000" >> /tmp/conf/app.ini - echo "ROOT_URL = http://gitea:3000" >> /tmp/conf/app.ini
- gitea migrate -c /tmp/conf/app.ini - gitea migrate -c /tmp/conf/app.ini
- gitea admin create-user --username=test01 --password=test01 --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c /tmp/conf/app.ini - gitea admin user create --username=test01 --password=test01 --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c /tmp/conf/app.ini
- gitea web -c /tmp/conf/app.ini - gitea web -c /tmp/conf/app.ini
- name: testing - name: testing

View file

@ -25,7 +25,7 @@ help:
.PHONY: clean .PHONY: clean
clean: clean:
rm -r -f test rm -r -f test
$(GO) clean -i ./... cd gitea && $(GO) clean -i ./...
.PHONY: fmt .PHONY: fmt
fmt: fmt:
@ -68,10 +68,10 @@ test-instance:
echo "DB_TYPE = sqlite3" >> ${WORK_DIR}/test/conf/app.ini; \ echo "DB_TYPE = sqlite3" >> ${WORK_DIR}/test/conf/app.ini; \
echo "[repository]" >> ${WORK_DIR}/test/conf/app.ini; \ echo "[repository]" >> ${WORK_DIR}/test/conf/app.ini; \
echo "ROOT = ${WORK_DIR}/test/data/" >> ${WORK_DIR}/test/conf/app.ini; \ echo "ROOT = ${WORK_DIR}/test/data/" >> ${WORK_DIR}/test/conf/app.ini; \
echo "[server]" >> /tmp/conf/app.ini; \ echo "[server]" >> ${WORK_DIR}/test/conf/app.ini; \
echo "ROOT_URL = ${GITEA_SDK_TEST_URL}" >> /tmp/conf/app.ini; \ echo "ROOT_URL = ${GITEA_SDK_TEST_URL}" >> ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master migrate -c ${WORK_DIR}/test/conf/app.ini; \ ${WORK_DIR}/test/gitea-master migrate -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master admin create-user --username=${GITEA_SDK_TEST_USERNAME} --password=${GITEA_SDK_TEST_PASSWORD} --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c ${WORK_DIR}/test/conf/app.ini; \ ${WORK_DIR}/test/gitea-master admin user create --username=${GITEA_SDK_TEST_USERNAME} --password=${GITEA_SDK_TEST_PASSWORD} --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master web -c ${WORK_DIR}/test/conf/app.ini ${WORK_DIR}/test/gitea-master web -c ${WORK_DIR}/test/conf/app.ini
.PHONY: bench .PHONY: bench

View file

@ -43,7 +43,7 @@ func TestAdminCronTasks(t *testing.T) {
tasks, _, err := c.ListCronTasks(ListCronTaskOptions{}) tasks, _, err := c.ListCronTasks(ListCronTaskOptions{})
assert.NoError(t, err) assert.NoError(t, err)
assert.Len(t, tasks, 15) assert.Len(t, tasks, 16)
_, err = c.RunCronTasks(tasks[0].Name) _, err = c.RunCronTasks(tasks[0].Name)
assert.NoError(t, err) assert.NoError(t, err)
} }