Update tests to new changes upstream (#518)
as title Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/518 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Norwin <noerw@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
e11a4f7f3b
commit
42fed7165c
2 changed files with 7 additions and 7 deletions
12
Makefile
12
Makefile
|
@ -7,7 +7,7 @@ GITEA_SDK_TEST_USERNAME ?= test01
|
|||
GITEA_SDK_TEST_PASSWORD ?= test01
|
||||
|
||||
|
||||
GITEA_DL := https://dl.gitea.io/gitea/master/gitea-master-
|
||||
GITEA_DL := https://dl.gitea.io/gitea/main/gitea-main-
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
GITEA_DL := $(GITEA_DL)linux-
|
||||
|
@ -81,8 +81,8 @@ test:
|
|||
test-instance:
|
||||
rm -f -r ${WORK_DIR}/test 2> /dev/null; \
|
||||
mkdir -p ${WORK_DIR}/test/conf/ ${WORK_DIR}/test/data/
|
||||
wget ${GITEA_DL} -O ${WORK_DIR}/test/gitea-master; \
|
||||
chmod +x ${WORK_DIR}/test/gitea-master; \
|
||||
wget ${GITEA_DL} -O ${WORK_DIR}/test/gitea-main; \
|
||||
chmod +x ${WORK_DIR}/test/gitea-main; \
|
||||
echo "[security]" > ${WORK_DIR}/test/conf/app.ini; \
|
||||
echo "INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NTg4MzY4ODB9.LoKQyK5TN_0kMJFVHWUW0uDAyoGjDP6Mkup4ps2VJN4" >> ${WORK_DIR}/test/conf/app.ini; \
|
||||
echo "INSTALL_LOCK = true" >> ${WORK_DIR}/test/conf/app.ini; \
|
||||
|
@ -94,9 +94,9 @@ test-instance:
|
|||
echo "ROOT = ${WORK_DIR}/test/data/" >> ${WORK_DIR}/test/conf/app.ini; \
|
||||
echo "[server]" >> ${WORK_DIR}/test/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 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-main migrate -c ${WORK_DIR}/test/conf/app.ini; \
|
||||
${WORK_DIR}/test/gitea-main 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-main web -c ${WORK_DIR}/test/conf/app.ini
|
||||
|
||||
.PHONY: bench
|
||||
bench:
|
||||
|
|
|
@ -45,7 +45,7 @@ func TestAdminCronTasks(t *testing.T) {
|
|||
|
||||
tasks, _, err := c.ListCronTasks(ListCronTaskOptions{})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, tasks, 17)
|
||||
assert.Len(t, tasks, 18)
|
||||
_, err = c.RunCronTasks(tasks[0].Name)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue