From fbced09e40f4f26fc1b8028637f983b79b9c173e Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:05:04 +0800 Subject: [PATCH 01/79] Add .circleci/config.yml --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..c5d643ba3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 +orbs: + browser-tools: circleci/browser-tools@1.1.3 +jobs: + build: + working_directory: /go/src/github.com/GoAdminGroup/go-admin + docker: + - image: circleci/golang:1.15.8 + - image: circleci/mysql:5.7 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test + - image: circleci/postgres:9.6-alpine + environment: # environment variables for primary container + POSTGRES_USER: postgres + POSTGRES_DB: go-admin-test + - image: 'cimg/node:13.12-browser' + steps: + - browser-tools/install-chrome + - browser-tools/install-chromedriver + - run: + command: | + google-chrome --version + chromedriver --version + google-chrome --headless --disable-gpu --remote-debugging-port=9222 http://localhost & + name: Check chrome tools and start + - checkout + - restore_cache: + keys: + - go-mod-v4-{{ checksum "go.sum" }} + - run: + name: Install Dependencies + command: | + go mod download + go get -u github.com/rakyll/gotest + go get -u -v github.com/gogf/gf@v1.12.1 + sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + go get github.com/GoAdminGroup/themes@master + - save_cache: + key: go-mod-v4-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + # Wait for Postgres to be ready before proceeding + - run: + name: Waiting for Postgres to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: Build mssql environment + command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /home/travis/gopath/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest + - run: + name: Run tests + command: make test + - store_test_results: + path: /tmp/test-reports From 9ed87dd8ad3a5888329be99ecd85e2defa8ab6d1 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:07:32 +0800 Subject: [PATCH 02/79] Updated config.yml --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c5d643ba3..6fec61890 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,6 @@ jobs: environment: # environment variables for primary container POSTGRES_USER: postgres POSTGRES_DB: go-admin-test - - image: 'cimg/node:13.12-browser' steps: - browser-tools/install-chrome - browser-tools/install-chromedriver From efe576f4173c35cc4f41bba1cc5f8ff3e1f545e2 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:11:15 +0800 Subject: [PATCH 03/79] Updated config.yml --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6fec61890..5b3cceb2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,12 +44,13 @@ jobs: # Wait for Postgres to be ready before proceeding - run: name: Waiting for Postgres to be ready - command: dockerize -wait tcp://localhost:5432 -timeout 1m + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - setup_remote_docker: + version: 19.03.13 + docker_layer_caching: true - run: name: Build mssql environment command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /home/travis/gopath/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests command: make test - - store_test_results: - path: /tmp/test-reports From 3dffb034bdcb45e27d374f8066510d68feb1e09d Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:14:41 +0800 Subject: [PATCH 04/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b3cceb2c..789cc80ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,8 +46,7 @@ jobs: name: Waiting for Postgres to be ready command: dockerize -wait tcp://localhost:5432 -timeout 1m - setup_remote_docker: - version: 19.03.13 - docker_layer_caching: true + version: 19.03.13 - run: name: Build mssql environment command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /home/travis/gopath/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest From 072b020e66f60d3424c70bb49abf9bafbea0ab56 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:17:02 +0800 Subject: [PATCH 05/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 789cc80ec..8439904bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: version: 19.03.13 - run: name: Build mssql environment - command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /home/travis/gopath/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest + command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v $GOPATH/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests command: make test From 9740e53430e519d0731d27bc24eacf85924e9013 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:28:37 +0800 Subject: [PATCH 06/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8439904bd..05805ef95 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,10 +41,14 @@ jobs: key: go-mod-v4-{{ checksum "go.sum" }} paths: - "/go/pkg/mod" - # Wait for Postgres to be ready before proceeding - run: - name: Waiting for Postgres to be ready - command: dockerize -wait tcp://localhost:5432 -timeout 1m + name: Setup database + command: | + sudo apt-get install default-mysql-client + mysql -h 127.0.0.1 -u root -proot --execute="create database `go-admin-test`" + dockerize -wait tcp://localhost:5432 -timeout 1m + sudo apt install -y postgresql-client + createdb -U postgres go-admin-test - setup_remote_docker: version: 19.03.13 - run: From 834beed5274fcb2a1a8c415d0a9fc86c51cd6266 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:30:49 +0800 Subject: [PATCH 07/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 05805ef95..b74b32aa0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: name: Setup database command: | sudo apt-get install default-mysql-client - mysql -h 127.0.0.1 -u root -proot --execute="create database `go-admin-test`" + mysql -e 'create database `go-admin-test`;' dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client createdb -U postgres go-admin-test From 72f80e344ec0c5100325a3f6bcffa411e8049e07 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 08:55:02 +0800 Subject: [PATCH 08/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b74b32aa0..ca94e3c7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,6 +41,17 @@ jobs: key: go-mod-v4-{{ checksum "go.sum" }} paths: - "/go/pkg/mod" + - run: + # Our primary container isn't MYSQL so run a sleep command until it's ready. + name: Waiting for MySQL to be ready + command: | + for i in `seq 1 10`; + do + nc -z 127.0.0.1 3306 && echo Success && exit 0 + echo -n . + sleep 1 + done + echo Failed waiting for MySQL && exit 1 - run: name: Setup database command: | From bcf9cfb5cba55db5c92e0839494fea702b65eb09 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 09:04:08 +0800 Subject: [PATCH 09/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca94e3c7d..83b7c4728 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,23 +40,13 @@ jobs: - save_cache: key: go-mod-v4-{{ checksum "go.sum" }} paths: - - "/go/pkg/mod" - - run: - # Our primary container isn't MYSQL so run a sleep command until it's ready. - name: Waiting for MySQL to be ready - command: | - for i in `seq 1 10`; - do - nc -z 127.0.0.1 3306 && echo Success && exit 0 - echo -n . - sleep 1 - done - echo Failed waiting for MySQL && exit 1 + - "/go/pkg/mod" - run: name: Setup database command: | + dockerize -wait tcp://127.0.0.1:3306 -timeout 1m sudo apt-get install default-mysql-client - mysql -e 'create database `go-admin-test`;' + mysql -h 127.0.0.1 -u root -proot --execute="create database `go-admin-test`;" dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client createdb -U postgres go-admin-test From 5336fc6be22e1b0d4a5bab8a797e33bf1403b997 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 09:09:41 +0800 Subject: [PATCH 10/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83b7c4728..33a494fe6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ jobs: command: | dockerize -wait tcp://127.0.0.1:3306 -timeout 1m sudo apt-get install default-mysql-client - mysql -h 127.0.0.1 -u root -proot --execute="create database `go-admin-test`;" + mysql -h 127.0.0.1 -u root -proot --execute="create database \`go-admin-test\`;" dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client createdb -U postgres go-admin-test From 00c2b09c795e141f76837545a6734980582b53f5 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 09:12:52 +0800 Subject: [PATCH 11/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33a494fe6..1df8bcb6b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,8 +45,6 @@ jobs: name: Setup database command: | dockerize -wait tcp://127.0.0.1:3306 -timeout 1m - sudo apt-get install default-mysql-client - mysql -h 127.0.0.1 -u root -proot --execute="create database \`go-admin-test\`;" dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client createdb -U postgres go-admin-test From 7163d6a678e0ab96640a77127e0724f4ad9faf28 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 09:24:32 +0800 Subject: [PATCH 12/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1df8bcb6b..5ea222d93 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,9 +45,9 @@ jobs: name: Setup database command: | dockerize -wait tcp://127.0.0.1:3306 -timeout 1m + sudo apt-get install default-mysql-client dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client - createdb -U postgres go-admin-test - setup_remote_docker: version: 19.03.13 - run: From 3af6745d277cbccffdab9641848816d3acdfbc7a Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 09:40:33 +0800 Subject: [PATCH 13/79] test(ci): update Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cffa405ea..531edcde9 100644 --- a/Makefile +++ b/Makefile @@ -83,9 +83,9 @@ import-mysql: mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} go-admin-test < ./tests/data/admin.sql import-postgresql: - dropdb -U postgres go-admin-test - createdb -U postgres go-admin-test - psql -d go-admin-test -U postgres -f ./tests/data/admin_pg.sql + dropdb -h 127.0.0.1 -p 5432 -U postgres go-admin-test + createdb -h 127.0.0.1 -p 5432 -U postgres go-admin-test + psql -h 127.0.0.1 -p 5432 -d go-admin-test -U postgres -f ./tests/data/admin_pg.sql import-mssql: docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/home/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" From e92df273909f447a120cbe990afd5c3ad610967d Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 10:26:06 +0800 Subject: [PATCH 14/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ea222d93..89dd866ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,10 +49,10 @@ jobs: dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client - setup_remote_docker: - version: 19.03.13 + version: 19.03.13 - run: name: Build mssql environment - command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v $GOPATH/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest + command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests command: make test From cc21480a9eeba0d32884defeb7c7ce905f4d12a2 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 11:32:00 +0800 Subject: [PATCH 15/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 89dd866ac..3751b9813 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,9 @@ jobs: version: 19.03.13 - run: name: Build mssql environment - command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest + command: | + ll /go/src/github.com/GoAdminGroup/go-admin + docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests command: make test From 1223739e60a4cbf9851880de4b0c77d82dc634c8 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 11:37:45 +0800 Subject: [PATCH 16/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3751b9813..68a860681 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: - run: name: Build mssql environment command: | - ll /go/src/github.com/GoAdminGroup/go-admin + ls -l /go/src/github.com/GoAdminGroup/go-admin docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests From bccf69eeac28635bb123c5bff79ffa8d498733b7 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 11:55:09 +0800 Subject: [PATCH 17/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68a860681..fbe18f28c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: - run: name: Build mssql environment command: | - ls -l /go/src/github.com/GoAdminGroup/go-admin + sudo chmod -R 777 /go/src/github.com/GoAdminGroup/go-admin/tests/data docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - run: name: Run tests From 0f94430987ef9b9debce184d3db748f503e0c849 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 12:38:24 +0800 Subject: [PATCH 18/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fbe18f28c..53daa6e9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,8 +53,8 @@ jobs: - run: name: Build mssql environment command: | - sudo chmod -R 777 /go/src/github.com/GoAdminGroup/go-admin/tests/data docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest + docker cp /go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak mssql:/home/mssql/ - run: name: Run tests command: make test From 66e28b780b65e0851281e4bc277f8464b4b88638 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 13:01:07 +0800 Subject: [PATCH 19/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53daa6e9d..85bd88a43 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ jobs: name: Build mssql environment command: | docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - docker cp /go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak mssql:/home/mssql/ + docker cp /go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak mssql:/home/data/ - run: name: Run tests command: make test From d69f3a9cc948f726e9c00aca68ee785583d30f51 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 14:43:02 +0800 Subject: [PATCH 20/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85bd88a43..cd4eafc4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,9 +12,13 @@ jobs: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test - image: circleci/postgres:9.6-alpine - environment: # environment variables for primary container + environment: POSTGRES_USER: postgres POSTGRES_DB: go-admin-test + - image: mcr.microsoft.com/mssql/server:2017-latest + environment: + ACCEPT_EULA: Y + SA_PASSWORD: Aa123456 steps: - browser-tools/install-chrome - browser-tools/install-chromedriver @@ -48,13 +52,7 @@ jobs: sudo apt-get install default-mysql-client dockerize -wait tcp://localhost:5432 -timeout 1m sudo apt install -y postgresql-client - - setup_remote_docker: - version: 19.03.13 - - run: - name: Build mssql environment - command: | - docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /go/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - docker cp /go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak mssql:/home/data/ + dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Run tests command: make test From c7b021e0e17372b411c9223cfa6d7971a13dca46 Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 14:57:45 +0800 Subject: [PATCH 21/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd4eafc4a..bc4aab177 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: environment: POSTGRES_USER: postgres POSTGRES_DB: go-admin-test - - image: mcr.microsoft.com/mssql/server:2017-latest + - image: microsoft/mssql-server-linux:2017-CU8 environment: ACCEPT_EULA: Y SA_PASSWORD: Aa123456 From 4c907ca9e5138e2e6c777df608a9374a1df54cba Mon Sep 17 00:00:00 2001 From: cg33 Date: Thu, 27 May 2021 15:02:54 +0800 Subject: [PATCH 22/79] test(ci): upgrade circle.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc4aab177..1e09506e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,7 @@ jobs: - run: name: Setup database command: | + sqlcmd --help dockerize -wait tcp://127.0.0.1:3306 -timeout 1m sudo apt-get install default-mysql-client dockerize -wait tcp://localhost:5432 -timeout 1m From 2cb4fb73e0cb8635f2a5cebf2aad2f31d0cbe534 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 11:42:57 +0800 Subject: [PATCH 23/79] test(ci): add drone.yml --- .drone.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..2bad79a3b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,23 @@ +--- +kind: pipeline +name: compliance + +platform: + os: linux + arch: arm64 + +trigger: + event: + - push + - tag + - pull_request + +steps: + - name: test + pull: always + image: golang:1.14 + environment: + GO111MODULE: on + GOPROXY: off + commands: + - go version \ No newline at end of file From 5f085883053f683618fb1dfa5fbca8de20477d98 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 13:35:59 +0800 Subject: [PATCH 24/79] test(ci): add drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2bad79a3b..45e3e3e61 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: compliance +name: goadmin platform: os: linux From f88c16b523bba9469ad37a96dc9a1e6fcf3a1fc3 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 15:33:46 +0800 Subject: [PATCH 25/79] test(ci): add drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 45e3e3e61..595271701 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: goadmin +name: goadmin_test platform: os: linux From 351855cf391244d868fea76a809d65580d1470c9 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 16:23:34 +0800 Subject: [PATCH 26/79] test(ci): add drone.yml --- .drone.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 595271701..55cf2b5a1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,20 +1,9 @@ --- kind: pipeline -name: goadmin_test - -platform: - os: linux - arch: arm64 - -trigger: - event: - - push - - tag - - pull_request +name: default steps: - - name: test - pull: always + - name: backend image: golang:1.14 environment: GO111MODULE: on From b062b4250e204876d4405ec103b932f9588130b0 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 17:48:11 +0800 Subject: [PATCH 27/79] test(ci): add drone.yml --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 55cf2b5a1..f6d8359c0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,4 +9,5 @@ steps: GO111MODULE: on GOPROXY: off commands: - - go version \ No newline at end of file + - go version + - echo "hello world" \ No newline at end of file From 48c00f5d07586dc40667d6b943796b49b6994e7e Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 18:00:05 +0800 Subject: [PATCH 28/79] test(ci): add drone.yml --- .circleci/config.yml | 59 -------------------------------------------- .drone.yml | 19 ++++++++++++++ 2 files changed, 19 insertions(+), 59 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1e09506e4..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 -orbs: - browser-tools: circleci/browser-tools@1.1.3 -jobs: - build: - working_directory: /go/src/github.com/GoAdminGroup/go-admin - docker: - - image: circleci/golang:1.15.8 - - image: circleci/mysql:5.7 - environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test - - image: circleci/postgres:9.6-alpine - environment: - POSTGRES_USER: postgres - POSTGRES_DB: go-admin-test - - image: microsoft/mssql-server-linux:2017-CU8 - environment: - ACCEPT_EULA: Y - SA_PASSWORD: Aa123456 - steps: - - browser-tools/install-chrome - - browser-tools/install-chromedriver - - run: - command: | - google-chrome --version - chromedriver --version - google-chrome --headless --disable-gpu --remote-debugging-port=9222 http://localhost & - name: Check chrome tools and start - - checkout - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Install Dependencies - command: | - go mod download - go get -u github.com/rakyll/gotest - go get -u -v github.com/gogf/gf@v1.12.1 - sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - go get github.com/GoAdminGroup/themes@master - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - run: - name: Setup database - command: | - sqlcmd --help - dockerize -wait tcp://127.0.0.1:3306 -timeout 1m - sudo apt-get install default-mysql-client - dockerize -wait tcp://localhost:5432 -timeout 1m - sudo apt install -y postgresql-client - dockerize -wait tcp://localhost:5432 -timeout 1m - - run: - name: Run tests - command: make test diff --git a/.drone.yml b/.drone.yml index f6d8359c0..bb51f449b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,25 @@ kind: pipeline name: default +services: + - name: mysql + image: mysql:5.7 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test + + - name: pgsql + image: postgres:10 + environment: + POSTGRES_USER: postgres + POSTGRES_DB: go-admin-test + + - name: mssql + image: mcr.microsoft.com/mssql/server:latest + environment: + ACCEPT_EULA: Y + SA_PASSWORD: Aa123456 + steps: - name: backend image: golang:1.14 From 53dd139658eb0f93c1857b53241f56f94e1617a1 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 18:13:24 +0800 Subject: [PATCH 29/79] test(ci): add drone.yml --- .drone.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bb51f449b..0361fcd1f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,4 +29,6 @@ steps: GOPROXY: off commands: - go version - - echo "hello world" \ No newline at end of file + - echo "hello world" + - mysql -e 'create database `go-admin-test`;' + - createdb -U postgres go-admin-test \ No newline at end of file From b1cef19f1001e0a8db882e2557fe92fb3f28ec63 Mon Sep 17 00:00:00 2001 From: cg33 Date: Fri, 28 May 2021 21:35:58 +0800 Subject: [PATCH 30/79] test(ci): add drone.yml --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0361fcd1f..07d474b6c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,5 +30,5 @@ steps: commands: - go version - echo "hello world" - - mysql -e 'create database `go-admin-test`;' - - createdb -U postgres go-admin-test \ No newline at end of file + - apt-get update && apt-get install -y mysql-client + - mysql -h mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file From 7cf1d4a21e2ca5a583273abd0580e7fab1332f79 Mon Sep 17 00:00:00 2001 From: cg33 Date: Sat, 29 May 2021 07:35:23 +0800 Subject: [PATCH 31/79] test(ci): update drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 07d474b6c..e33e0a52c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,5 +30,5 @@ steps: commands: - go version - echo "hello world" - - apt-get update && apt-get install -y mysql-client + - apt-get install default-mysql-client - mysql -h mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file From ab984b6ced5ae324c46fb4ca74de3986f76c2f5d Mon Sep 17 00:00:00 2001 From: cg33 Date: Sat, 29 May 2021 08:13:57 +0800 Subject: [PATCH 32/79] test(ci): updade drone.yml --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index e33e0a52c..362aa738e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,12 +23,11 @@ services: steps: - name: backend - image: golang:1.14 + image: goadmin-test:v1 environment: GO111MODULE: on GOPROXY: off commands: - go version - echo "hello world" - - apt-get install default-mysql-client - mysql -h mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file From 061ed4090b0607b765ff75f4e0378b0df7a1980d Mon Sep 17 00:00:00 2001 From: cg33 Date: Sat, 29 May 2021 08:47:31 +0800 Subject: [PATCH 33/79] test(ci): update drone.yml --- .drone.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.drone.yml b/.drone.yml index 362aa738e..0c1c036f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,9 @@ kind: pipeline name: default +clone: + disable: true + services: - name: mysql image: mysql:5.7 @@ -22,6 +25,13 @@ services: SA_PASSWORD: Aa123456 steps: + - name: clone + image: alpine/git + commands: + - echo "199.232.69.194 github.global-ssl.fastly.net" >> /etc/hosts + - echo "140.82.113.4 github.com" >> /etc/hosts + - git clone https://github.com/GoAdminGroup/go-admin.git . + - git checkout $DRONE_COMMIT - name: backend image: goadmin-test:v1 environment: From 7d126fce777ca8af708b067df32705e42af3c26a Mon Sep 17 00:00:00 2001 From: cg33 Date: Sat, 29 May 2021 10:09:55 +0800 Subject: [PATCH 34/79] test(ci): update drone.yml --- .drone.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0c1c036f0..7bd7e07c9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,8 +2,8 @@ kind: pipeline name: default -clone: - disable: true +# clone: + # disable: true services: - name: mysql @@ -25,13 +25,13 @@ services: SA_PASSWORD: Aa123456 steps: - - name: clone - image: alpine/git - commands: - - echo "199.232.69.194 github.global-ssl.fastly.net" >> /etc/hosts - - echo "140.82.113.4 github.com" >> /etc/hosts - - git clone https://github.com/GoAdminGroup/go-admin.git . - - git checkout $DRONE_COMMIT + # - name: clone + # image: alpine/git + # commands: + # - echo "199.232.69.194 github.global-ssl.fastly.net" >> /etc/hosts + # - echo "140.82.113.4 github.com" >> /etc/hosts + # - git clone https://github.com/GoAdminGroup/go-admin.git . + # - git checkout $DRONE_COMMIT - name: backend image: goadmin-test:v1 environment: From c866327d56273c3926d340f2e69fc76091353f3a Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 10:04:58 +0800 Subject: [PATCH 35/79] test(ci): update drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7bd7e07c9..9bac11621 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,7 +33,7 @@ steps: # - git clone https://github.com/GoAdminGroup/go-admin.git . # - git checkout $DRONE_COMMIT - name: backend - image: goadmin-test:v1 + image: chg80333/goadmin-test:v1 environment: GO111MODULE: on GOPROXY: off From 3fcbfcf78953c1ad48a9a920ff5165a9002df7ea Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 10:46:07 +0800 Subject: [PATCH 36/79] test(ci): update drone.yml --- .drone.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9bac11621..2041beb4e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,19 +6,20 @@ name: default # disable: true services: - - name: mysql + - name: db_mysql image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test - - name: pgsql + - name: db_pgsql image: postgres:10 environment: POSTGRES_USER: postgres POSTGRES_DB: go-admin-test + POSTGRES_PASSWORD: root - - name: mssql + - name: db_mssql image: mcr.microsoft.com/mssql/server:latest environment: ACCEPT_EULA: Y @@ -40,4 +41,5 @@ steps: commands: - go version - echo "hello world" - - mysql -h mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file + - sleep 15 + - mysql -h db_mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file From c3e8600f3bb3a1245b8c22cdcc759f7f5fe4c11f Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 11:13:51 +0800 Subject: [PATCH 37/79] test(ci): update drone.yml --- .drone.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2041beb4e..cd3642d15 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,18 +12,18 @@ services: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test - - name: db_pgsql - image: postgres:10 - environment: - POSTGRES_USER: postgres - POSTGRES_DB: go-admin-test - POSTGRES_PASSWORD: root + # - name: db_pgsql + # image: postgres:10 + # environment: + # POSTGRES_USER: postgres + # POSTGRES_DB: go-admin-test + # POSTGRES_PASSWORD: root - - name: db_mssql - image: mcr.microsoft.com/mssql/server:latest - environment: - ACCEPT_EULA: Y - SA_PASSWORD: Aa123456 + # - name: db_mssql + # image: mcr.microsoft.com/mssql/server:latest + # environment: + # ACCEPT_EULA: Y + # SA_PASSWORD: Aa123456 steps: # - name: clone @@ -41,5 +41,5 @@ steps: commands: - go version - echo "hello world" - - sleep 15 - - mysql -h db_mysql -u root -proot -e 'create database \`go-admin-test\`;' \ No newline at end of file + - sleep 20 + - mysql -h db_mysql -u root -proot -e 'SELECT VERSION();' \ No newline at end of file From 9be5c306d89fbd8a8aca557fb9c1aede4c436fba Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 12:09:47 +0800 Subject: [PATCH 38/79] test(ci): update drone.yml --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index cd3642d15..c19aad299 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,8 @@ name: default # disable: true services: - - name: db_mysql - image: mysql:5.7 + - name: database + image: mysql environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test @@ -41,5 +41,5 @@ steps: commands: - go version - echo "hello world" - - sleep 20 - - mysql -h db_mysql -u root -proot -e 'SELECT VERSION();' \ No newline at end of file + - sleep 100 + - mysql -h database -u root -proot -e 'SELECT VERSION();' \ No newline at end of file From 9c850d59ba82df06a75b60080ccb0b35d2961674 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 13:13:32 +0800 Subject: [PATCH 39/79] test(ci): update drone.yml --- .drone.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index c19aad299..5780c5ec1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,10 +7,11 @@ name: default services: - name: database - image: mysql + image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test + MYSQL_PASSWORD: root # - name: db_pgsql # image: postgres:10 @@ -33,13 +34,14 @@ steps: # - echo "140.82.113.4 github.com" >> /etc/hosts # - git clone https://github.com/GoAdminGroup/go-admin.git . # - git checkout $DRONE_COMMIT + # chg80333/goadmin-test:v1 - name: backend - image: chg80333/goadmin-test:v1 + image: mysql:5.7 environment: GO111MODULE: on GOPROXY: off commands: - - go version - - echo "hello world" - - sleep 100 + # - go version + # - echo "hello world" + - sleep 50 - mysql -h database -u root -proot -e 'SELECT VERSION();' \ No newline at end of file From 13f214d3e4fcac1d8b86000890c8af4f2c4d6dd5 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 17:56:07 +0800 Subject: [PATCH 40/79] test(ci): update drone.yml --- .drone.yml | 53 +++++++++++------------------------------------------ 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5780c5ec1..7c9424f69 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,47 +1,16 @@ ---- kind: pipeline name: default -# clone: - # disable: true +steps: +- name: test + image: mysql + commands: + - sleep 15 + - mysql -u root -h database --execute="SELECT VERSION();" services: - - name: database - image: mysql:5.7 - environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test - MYSQL_PASSWORD: root - - # - name: db_pgsql - # image: postgres:10 - # environment: - # POSTGRES_USER: postgres - # POSTGRES_DB: go-admin-test - # POSTGRES_PASSWORD: root - - # - name: db_mssql - # image: mcr.microsoft.com/mssql/server:latest - # environment: - # ACCEPT_EULA: Y - # SA_PASSWORD: Aa123456 - -steps: - # - name: clone - # image: alpine/git - # commands: - # - echo "199.232.69.194 github.global-ssl.fastly.net" >> /etc/hosts - # - echo "140.82.113.4 github.com" >> /etc/hosts - # - git clone https://github.com/GoAdminGroup/go-admin.git . - # - git checkout $DRONE_COMMIT - # chg80333/goadmin-test:v1 - - name: backend - image: mysql:5.7 - environment: - GO111MODULE: on - GOPROXY: off - commands: - # - go version - # - echo "hello world" - - sleep 50 - - mysql -h database -u root -proot -e 'SELECT VERSION();' \ No newline at end of file +- name: database + image: mysql + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MYSQL_DATABASE: test \ No newline at end of file From a71a3c8f12ad9e1560c7e76f155ce00e0d2fb500 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 18:18:45 +0800 Subject: [PATCH 41/79] test(ci): update drone.yml --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7c9424f69..9224d1d14 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,14 +3,14 @@ name: default steps: - name: test - image: mysql + image: mysql:5.7 commands: - sleep 15 - mysql -u root -h database --execute="SELECT VERSION();" services: - name: database - image: mysql + image: mysql:5.7 environment: MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' MYSQL_DATABASE: test \ No newline at end of file From 711d4585271d9c702482565942ecca89da323499 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 18:40:59 +0800 Subject: [PATCH 42/79] test(ci): update drone.yml --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9224d1d14..0e49f46ea 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,10 +6,10 @@ steps: image: mysql:5.7 commands: - sleep 15 - - mysql -u root -h database --execute="SELECT VERSION();" + - mysql -u root -h db --execute="SELECT VERSION();" services: -- name: database +- name: db image: mysql:5.7 environment: MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' From fe66b071b63da5b54babe524cbd842fdfae0fcb9 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 19:57:32 +0800 Subject: [PATCH 43/79] test(ci): update drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0e49f46ea..daf2e821c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ steps: - name: test image: mysql:5.7 commands: - - sleep 15 + - sleep 200 - mysql -u root -h db --execute="SELECT VERSION();" services: From ecae7346422835771a0de854d6596e13aa68aa5b Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 20:23:48 +0800 Subject: [PATCH 44/79] test(ci): update drone.yml\ --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index daf2e821c..a9afa090d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,13 +3,13 @@ name: default steps: - name: test - image: mysql:5.7 + image: chg80333/goadmin-test commands: - - sleep 200 - - mysql -u root -h db --execute="SELECT VERSION();" + - sleep 500 + - mysql -u root -h database --execute="SELECT VERSION();" services: -- name: db +- name: database image: mysql:5.7 environment: MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' From 4aae5399ce3cd8e67c2309e735b5a5dc01b44571 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 21:35:35 +0800 Subject: [PATCH 45/79] test(ci): update drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a9afa090d..4d70420f9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ name: default steps: - name: test - image: chg80333/goadmin-test + image: chg80333/goadmin-test:v1 commands: - sleep 500 - mysql -u root -h database --execute="SELECT VERSION();" From 76d76a2654a40c0df1ca6feb09faa39c12a1b2e8 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 22:16:12 +0800 Subject: [PATCH 46/79] test(ci): update drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4d70420f9..1e95a0a41 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ kind: pipeline name: default steps: -- name: test +- name: goadmin_test image: chg80333/goadmin-test:v1 commands: - sleep 500 From 6c41f29b7f7955bac3206d233578816d6d576946 Mon Sep 17 00:00:00 2001 From: cg33 Date: Mon, 31 May 2021 23:36:28 +0800 Subject: [PATCH 47/79] test(ci): update drone.yml --- .drone.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1e95a0a41..e54b52963 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,16 +1,30 @@ kind: pipeline name: default +# clone: +# disable: true + steps: +# - name: clone +# image: alpine/git +# commands: +# - git clone https://github.com/GoAdminGroup/go-admin.git . +# - git checkout $DRONE_COMMIT + - name: goadmin_test image: chg80333/goadmin-test:v1 commands: - - sleep 500 - - mysql -u root -h database --execute="SELECT VERSION();" + - sleep 250 + - mysql -u root -proot -h db_mysql --execute="SELECT VERSION();" + - ls -l + - go get -u github.com/rakyll/gotest + - go get -u -v github.com/gogf/gf@v1.12.1 + - sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + - sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go services: -- name: database +- name: db_mysql image: mysql:5.7 environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - MYSQL_DATABASE: test \ No newline at end of file + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test \ No newline at end of file From b97a16e039b7bafe8e19ae860f3f1a1c868434d7 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 08:47:04 +0800 Subject: [PATCH 48/79] test(ci): update drone.yml --- .drone.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index e54b52963..6bf69e172 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,8 @@ kind: pipeline name: default -# clone: -# disable: true +clone: + disable: true steps: # - name: clone @@ -12,8 +12,10 @@ steps: # - git checkout $DRONE_COMMIT - name: goadmin_test - image: chg80333/goadmin-test:v1 + image: chg80333/goadmin-test:v2 commands: + - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout $DRONE_COMMIT - sleep 250 - mysql -u root -proot -h db_mysql --execute="SELECT VERSION();" - ls -l From 3e33e4be18e59819d5b60254e5188a0731e64614 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 09:01:05 +0800 Subject: [PATCH 49/79] test(ci): update drone.yml --- .drone.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6bf69e172..fff15414f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,16 +13,18 @@ steps: - name: goadmin_test image: chg80333/goadmin-test:v2 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn commands: - - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - - git checkout $DRONE_COMMIT - - sleep 250 - - mysql -u root -proot -h db_mysql --execute="SELECT VERSION();" - - ls -l - - go get -u github.com/rakyll/gotest + - go get -u -v github.com/rakyll/gotest - go get -u -v github.com/gogf/gf@v1.12.1 - sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout $DRONE_COMMIT + - sleep 80 + - mysql -u root -proot -h db_mysql --execute="SELECT VERSION();" services: - name: db_mysql From 483303a04242ecffe73097369521b8d7c928caf3 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 09:08:58 +0800 Subject: [PATCH 50/79] test(ci): update drone.yml --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index fff15414f..b5ebcc29d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,8 +19,8 @@ steps: commands: - go get -u -v github.com/rakyll/gotest - go get -u -v github.com/gogf/gf@v1.12.1 - - sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - - sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + - chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - git checkout $DRONE_COMMIT - sleep 80 From 54a61c91121c6940040ce6e432c6e8bb3d358b2f Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 09:23:49 +0800 Subject: [PATCH 51/79] test(ci): update drone.yml --- .drone.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index b5ebcc29d..80a84bd9e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - git checkout $DRONE_COMMIT - sleep 80 - - mysql -u root -proot -h db_mysql --execute="SELECT VERSION();" + - make mysql-test services: - name: db_mysql diff --git a/Makefile b/Makefile index 531edcde9..c4a20b942 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ TEST_CONFIG_MS_PATH=./../../common/config_ms.json TEST_FRAMEWORK_DIR=./tests/frameworks ## database configs -MYSQL_HOST = 127.0.0.1 +MYSQL_HOST = db_mysql MYSQL_PORT = 3306 MYSQL_USER = root MYSQL_PWD = root From 6cb726c5ea40d75060ea85005053b601fdd9100f Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 10:26:13 +0800 Subject: [PATCH 52/79] test(ci): update tests config.json --- .drone.yml | 2 +- tests/common/config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 80a84bd9e..ee4f26abd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ steps: # - git checkout $DRONE_COMMIT - name: goadmin_test - image: chg80333/goadmin-test:v2 + image: chg80333/goadmin-test:v3 environment: GO111MODULE: on GOPROXY: https://goproxy.cn diff --git a/tests/common/config.json b/tests/common/config.json index 9951dabb0..3a3c0de3b 100644 --- a/tests/common/config.json +++ b/tests/common/config.json @@ -1,7 +1,7 @@ { "database": { "default": { - "host": "127.0.0.1", + "host": "db_mysql", "port": "3306", "user": "root", "pwd": "root", From 4c92c9a110d169d6b6630bd0d73dccf21b205090 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 10:41:55 +0800 Subject: [PATCH 53/79] test(ci): update drone.yml --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index ee4f26abd..6c4049969 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,9 +18,9 @@ steps: GOPROXY: https://goproxy.cn commands: - go get -u -v github.com/rakyll/gotest - - go get -u -v github.com/gogf/gf@v1.12.1 - - chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go + - go get -u -v github.com/gogf/gf@v1.16.1 + - chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go + - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - git checkout $DRONE_COMMIT - sleep 80 From 30eb88b99f14f5fff7161a860ecc615d40b0b29f Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 11:09:57 +0800 Subject: [PATCH 54/79] test(ci): update drone.yml --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 6c4049969..4069687a8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,6 +23,7 @@ steps: - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - git checkout $DRONE_COMMIT + - ls -l /go/pkg/mod/github.com/\!go\!admin\!group/ - sleep 80 - make mysql-test From 8e06387e8816261a09de737a9a77fd7a80493a2c Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 13:21:38 +0800 Subject: [PATCH 55/79] test(ci): update drone.yml --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 4069687a8..38d6d21df 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,6 +22,7 @@ steps: - chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - ls -l /go/pkg/mod/github.com/\!go\!admin\!group/ - sleep 80 From 7c5f87907b3ebecbc544b3a396e818b33f404bf1 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 13:40:28 +0800 Subject: [PATCH 56/79] test(ci): update drone.yml --- .drone.yml | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 38d6d21df..86cf3d325 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,36 +1,54 @@ +--- kind: pipeline -name: default +name: mysql_test clone: disable: true -steps: -# - name: clone -# image: alpine/git -# commands: -# - git clone https://github.com/GoAdminGroup/go-admin.git . -# - git checkout $DRONE_COMMIT +services: +- name: db_mysql + image: mysql:5.7 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test +steps: - name: goadmin_test image: chg80333/goadmin-test:v3 environment: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - - go get -u -v github.com/rakyll/gotest - - go get -u -v github.com/gogf/gf@v1.16.1 - - chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - - echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.16.1/net/ghttp/ghttp_server_handler.go - cd /go/src/github.com/GoAdminGroup/go-admin && git pull - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - - ls -l /go/pkg/mod/github.com/\!go\!admin\!group/ - sleep 80 - make mysql-test +--- +kind: pipeline +name: postgresql_test + +clone: + disable: true + services: - name: db_mysql image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test \ No newline at end of file + MYSQL_DATABASE: go-admin-test + +steps: +- name: goadmin_test + image: chg80333/goadmin-test:v3 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn + commands: + - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout -- go.mod go.sum + - git checkout $DRONE_COMMIT + - sleep 80 + - make pg-test + \ No newline at end of file From c349b99b0d31ac5d7dbce7f017f83d01b426d1b1 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 14:03:44 +0800 Subject: [PATCH 57/79] test(ci): upgrade drone ci --- .drone.yml | 54 ++++++++++++++++++++++++++++++++++--- Makefile | 25 ++++++++--------- tests/common/config_ms.json | 2 +- tests/common/config_pg.json | 2 +- tests/frameworks/gf/gf.go | 3 +-- 5 files changed, 66 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 86cf3d325..6c92c6c0f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,7 @@ services: MYSQL_DATABASE: go-admin-test steps: -- name: goadmin_test +- name: api_test image: chg80333/goadmin-test:v3 environment: GO111MODULE: on @@ -33,14 +33,14 @@ clone: disable: true services: -- name: db_mysql +- name: db_pgsql image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: go-admin-test steps: -- name: goadmin_test +- name: api_test image: chg80333/goadmin-test:v3 environment: GO111MODULE: on @@ -51,4 +51,50 @@ steps: - git checkout $DRONE_COMMIT - sleep 80 - make pg-test - \ No newline at end of file + +--- +kind: pipeline +name: sqlite_test + +clone: + disable: true + +steps: +- name: api_test + image: chg80333/goadmin-test:v3 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn + commands: + - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout -- go.mod go.sum + - git checkout $DRONE_COMMIT + - sleep 80 + - make sqlite-test + +--- +kind: pipeline +name: mssql_test + +clone: + disable: true + +services: +- name: db_mssql + image: mcr.microsoft.com/mssql/server:2017-latest + environment: + ACCEPT_EULA: Y + SA_PASSWORD: Aa123456 + +steps: +- name: api_test + image: chg80333/goadmin-test:v3 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn + commands: + - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - git checkout -- go.mod go.sum + - git checkout $DRONE_COMMIT + - sleep 80 + - make ms-test \ No newline at end of file diff --git a/Makefile b/Makefile index c4a20b942..7a7de9bc0 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,12 @@ MYSQL_PORT = 3306 MYSQL_USER = root MYSQL_PWD = root +POSTGRESSQL_HOST = db_pgsql +POSTGRESSQL_PORT = 5432 +POSTGRESSQL_USER = postgres + +TEST_DB = go-admin-test + all: test ## tests @@ -79,25 +85,20 @@ import-sqlite: cp ./tests/data/admin.db ./tests/common/admin.db import-mysql: - mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} -e "create database if not exists \`go-admin-test\`" - mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} go-admin-test < ./tests/data/admin.sql + mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} -e "create database if not exists \`${TEST_DB}\`" + mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} ${TEST_DB} < ./tests/data/admin.sql import-postgresql: - dropdb -h 127.0.0.1 -p 5432 -U postgres go-admin-test - createdb -h 127.0.0.1 -p 5432 -U postgres go-admin-test - psql -h 127.0.0.1 -p 5432 -d go-admin-test -U postgres -f ./tests/data/admin_pg.sql + dropdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} + createdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} + psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql import-mssql: - docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/home/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" + sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" backup-mssql: docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "BACKUP DATABASE [goadmin] TO DISK = N'/home/data/admin_ms.bak' WITH NOFORMAT, NOINIT, NAME = 'goadmin-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10" -fix-gf: - go get -u -v github.com/gogf/gf@v1.12.1 - sudo chmod -R 777 $(GOPATH)/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - sudo echo "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $(GOPATH)/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - cp-mod: cp go.mod go.mod.old cp go.sum go.sum.old @@ -154,4 +155,4 @@ cli: cp ./adm/build/windows/i386/adm_windows_i386_$(VERSION).zip ./adm/build/zip/ cp ./adm/build/mac/adm_darwin_x86_64_$(VERSION).zip ./adm/build/zip/ -.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test fix-gf lint cilint cli +.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test lint cilint cli diff --git a/tests/common/config_ms.json b/tests/common/config_ms.json index 9e115e52f..daddb0f0a 100644 --- a/tests/common/config_ms.json +++ b/tests/common/config_ms.json @@ -1,7 +1,7 @@ { "database": { "default": { - "host": "127.0.0.1", + "host": "db_mssql", "port": "1433", "user": "sa", "pwd": "Aa123456", diff --git a/tests/common/config_pg.json b/tests/common/config_pg.json index 91c67c780..b308d6db2 100644 --- a/tests/common/config_pg.json +++ b/tests/common/config_pg.json @@ -1,7 +1,7 @@ { "database": { "default": { - "host": "127.0.0.1", + "host": "db_pgsql", "port": "5432", "user": "postgres", "pwd": "root", diff --git a/tests/frameworks/gf/gf.go b/tests/frameworks/gf/gf.go index 483a63008..79c218df1 100644 --- a/tests/frameworks/gf/gf.go +++ b/tests/frameworks/gf/gf.go @@ -58,6 +58,5 @@ func (hh *httpHandler) SetSrv(s *ghttp.Server) *httpHandler { } func (hh *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // NOTE: ╮(╯▽╰)╭ - hh.srv.DefaultHttpHandle(w, r) + hh.srv.ServeHTTP(w, r) } From 85992ebd9c2f25a21c21c6b1d9d0e791ed880e51 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 14:32:30 +0800 Subject: [PATCH 58/79] test(ci): update drone.yml --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6c92c6c0f..44f39e220 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v3 + image: chg80333/goadmin-test:v4 environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -41,7 +41,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v3 + image: chg80333/goadmin-test:v4 environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -61,7 +61,7 @@ clone: steps: - name: api_test - image: chg80333/goadmin-test:v3 + image: chg80333/goadmin-test:v4 environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -88,7 +88,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v3 + image: chg80333/goadmin-test:v4 environment: GO111MODULE: on GOPROXY: https://goproxy.cn From 3560f16f836843a58839c95680c0a1125698f872 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 14:45:19 +0800 Subject: [PATCH 59/79] test(ci): update drone.yml --- .drone.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 44f39e220..5c33a16eb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,7 +10,7 @@ services: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test + MYSQL_DATABASE: go-admin-test steps: - name: api_test @@ -34,10 +34,11 @@ clone: services: - name: db_pgsql - image: mysql:5.7 + image: postgres:10 environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test + POSTGRES_USER: postgres + POSTGRES_DB: go-admin-test + POSTGRES_PASSWORD: root steps: - name: api_test From d89838ff3c5d724ad4c917aa7914097afd5c331a Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 14:57:35 +0800 Subject: [PATCH 60/79] test(ci): upgrade drone ci --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7a7de9bc0..f315be417 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ MYSQL_PWD = root POSTGRESSQL_HOST = db_pgsql POSTGRESSQL_PORT = 5432 POSTGRESSQL_USER = postgres +POSTGRESSQL_PWD = root TEST_DB = go-admin-test @@ -89,9 +90,9 @@ import-mysql: mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} ${TEST_DB} < ./tests/data/admin.sql import-postgresql: - dropdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} - createdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} - psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql + PGPASSWORD=${POSTGRESSQL_PWD} dropdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} + PGPASSWORD=${POSTGRESSQL_PWD} createdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB} + PGPASSWORD=${POSTGRESSQL_PWD} psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql import-mssql: sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" From 7595a749bc36a0fc9e194785871d0cf165b29370 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:11:41 +0800 Subject: [PATCH 61/79] test(ci): upgrade drone ci --- .drone.yml | 24 ++++++++++++------------ Makefile | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5c33a16eb..aa323b656 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,16 +1,16 @@ --- kind: pipeline -name: mysql_test +name: mssql_test clone: disable: true services: -- name: db_mysql - image: mysql:5.7 +- name: db_mssql + image: mcr.microsoft.com/mssql/server:2017-latest environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test + ACCEPT_EULA: Y + SA_PASSWORD: Aa123456 steps: - name: api_test @@ -23,7 +23,7 @@ steps: - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 - - make mysql-test + - make ms-test --- kind: pipeline @@ -75,17 +75,17 @@ steps: --- kind: pipeline -name: mssql_test +name: mysql_test clone: disable: true services: -- name: db_mssql - image: mcr.microsoft.com/mssql/server:2017-latest +- name: db_mysql + image: mysql:5.7 environment: - ACCEPT_EULA: Y - SA_PASSWORD: Aa123456 + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test steps: - name: api_test @@ -98,4 +98,4 @@ steps: - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 - - make ms-test \ No newline at end of file + - make mysql-test \ No newline at end of file diff --git a/Makefile b/Makefile index f315be417..4a14887cc 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ import-postgresql: PGPASSWORD=${POSTGRESSQL_PWD} psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql import-mssql: - sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" + /opt/mssql-tools/bin/sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" backup-mssql: docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "BACKUP DATABASE [goadmin] TO DISK = N'/home/data/admin_ms.bak' WITH NOFORMAT, NOINIT, NAME = 'goadmin-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10" From dede9c2584987db8ce5c5a1b99f5e9057e85fe9a Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:22:43 +0800 Subject: [PATCH 62/79] test(ci): upgrade drone ci --- .drone.yml | 15 +++++++++++++-- Makefile | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index aa323b656..29d889372 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,16 +5,22 @@ name: mssql_test clone: disable: true -services: +steps: - name: db_mssql image: mcr.microsoft.com/mssql/server:2017-latest + volumes: + - name: data + path: /home/data environment: ACCEPT_EULA: Y SA_PASSWORD: Aa123456 + detach: true -steps: - name: api_test image: chg80333/goadmin-test:v4 + volumes: + - name: data + path: /go/src/github.com/GoAdminGroup/go-admin/tests/data environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -25,6 +31,11 @@ steps: - sleep 80 - make ms-test +volumes: +- name: data + host: + path: /data/drone/data + --- kind: pipeline name: postgresql_test diff --git a/Makefile b/Makefile index 4a14887cc..8e6caa544 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ import-postgresql: PGPASSWORD=${POSTGRESSQL_PWD} psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql import-mssql: - /opt/mssql-tools/bin/sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" + /opt/mssql-tools/bin/sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/home/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5" backup-mssql: docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "BACKUP DATABASE [goadmin] TO DISK = N'/home/data/admin_ms.bak' WITH NOFORMAT, NOINIT, NAME = 'goadmin-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10" From e694251bc7930841017ad888ea1dee25129bc3ad Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:27:42 +0800 Subject: [PATCH 63/79] test(ci): update drone.yml --- .drone.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 29d889372..e1813659f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,8 +5,14 @@ name: mssql_test clone: disable: true +volumes: +- name: data + host: + path: /data/drone/data + steps: - name: db_mssql + detach: true image: mcr.microsoft.com/mssql/server:2017-latest volumes: - name: data @@ -14,7 +20,6 @@ steps: environment: ACCEPT_EULA: Y SA_PASSWORD: Aa123456 - detach: true - name: api_test image: chg80333/goadmin-test:v4 @@ -31,11 +36,6 @@ steps: - sleep 80 - make ms-test -volumes: -- name: data - host: - path: /data/drone/data - --- kind: pipeline name: postgresql_test From 770516b98cc544bdaf6998bab8d72d31a794f360 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:33:27 +0800 Subject: [PATCH 64/79] test(ci): upgrade drone ci --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index e1813659f..7c6f0fc9d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,17 +10,17 @@ volumes: host: path: /data/drone/data -steps: +services: - name: db_mssql - detach: true image: mcr.microsoft.com/mssql/server:2017-latest volumes: - name: data path: /home/data environment: ACCEPT_EULA: Y - SA_PASSWORD: Aa123456 + SA_PASSWORD: Aa123456 +steps: - name: api_test image: chg80333/goadmin-test:v4 volumes: From f33f5c5a0dd7b1274b6af5908f26a5f56e9c6d73 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:38:04 +0800 Subject: [PATCH 65/79] test(ci): upgrade drone ci --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 7c6f0fc9d..a60615210 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,6 +20,7 @@ services: ACCEPT_EULA: Y SA_PASSWORD: Aa123456 + steps: - name: api_test image: chg80333/goadmin-test:v4 From ee64708a606a46d29a6c89298f20635812365b09 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 15:53:58 +0800 Subject: [PATCH 66/79] test(ci): upgrade drone ci --- .drone.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index a60615210..4b5b46c90 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,5 +1,6 @@ --- kind: pipeline +type: docker name: mssql_test clone: @@ -7,8 +8,7 @@ clone: volumes: - name: data - host: - path: /data/drone/data + temp: {} services: - name: db_mssql @@ -18,8 +18,7 @@ services: path: /home/data environment: ACCEPT_EULA: Y - SA_PASSWORD: Aa123456 - + SA_PASSWORD: Aa123456 steps: - name: api_test @@ -39,6 +38,7 @@ steps: --- kind: pipeline +type: docker name: postgresql_test clone: @@ -67,6 +67,7 @@ steps: --- kind: pipeline +type: docker name: sqlite_test clone: @@ -87,6 +88,7 @@ steps: --- kind: pipeline +type: docker name: mysql_test clone: From 04e06a5a270b33c6b4011f990ca0b2bbabb20862 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 16:24:00 +0800 Subject: [PATCH 67/79] test(ci): upgrade drone ci --- .drone.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4b5b46c90..a84f45b31 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,7 +30,9 @@ steps: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -59,7 +61,9 @@ steps: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -80,7 +84,9 @@ steps: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -108,7 +114,9 @@ steps: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - - cd /go/src/github.com/GoAdminGroup/go-admin && git pull + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 From 631dc6fcb73305ce96cda63984ac70c21a79c9aa Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 16:41:44 +0800 Subject: [PATCH 68/79] test(ci): upgrade drone ci --- .drone.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index a84f45b31..687c6691a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,8 +31,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull - - while (($? == 1)); do sleep 2;git pull; done + - git pull; while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -62,8 +61,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull - - while (($? == 1)); do sleep 2;git pull; done + - git pull; while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -85,8 +83,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull - - while (($? == 1)); do sleep 2;git pull; done + - git pull; while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -115,8 +112,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull - - while (($? == 1)); do sleep 2;git pull; done + - git pull; while (($? == 1)); do sleep 2;git pull; done - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 From 5ecb38dfd6535467259f17edce27a7f86e3ce3a0 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 19:35:13 +0800 Subject: [PATCH 69/79] test(ci): update drone.yml --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 687c6691a..ab48fbb09 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v4 + image: chg80333/goadmin-test:v6 volumes: - name: data path: /go/src/github.com/GoAdminGroup/go-admin/tests/data @@ -55,7 +55,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v4 + image: chg80333/goadmin-test:v6 environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -77,7 +77,7 @@ clone: steps: - name: api_test - image: chg80333/goadmin-test:v4 + image: chg80333/goadmin-test:v6 environment: GO111MODULE: on GOPROXY: https://goproxy.cn @@ -106,7 +106,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v4 + image: chg80333/goadmin-test:v6 environment: GO111MODULE: on GOPROXY: https://goproxy.cn From 7b7c8cbfa1b70d7ff398715648d31b72ece44059 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 19:43:54 +0800 Subject: [PATCH 70/79] test(ci): update drone.yml --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index ab48fbb09..0bd89a150 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull; while (($? == 1)); do sleep 2;git pull; done + - git pull -q - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -61,7 +61,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull; while (($? == 1)); do sleep 2;git pull; done + - git pull -q - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -83,7 +83,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull; while (($? == 1)); do sleep 2;git pull; done + - git pull -q - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 @@ -112,7 +112,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull; while (($? == 1)); do sleep 2;git pull; done + - git pull -q - git checkout -- go.mod go.sum - git checkout $DRONE_COMMIT - sleep 80 From bb81cbefb4ec43bba2562a7bfb4e2b416ab8c325 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 20:58:08 +0800 Subject: [PATCH 71/79] test(ci): update drone.yml --- .drone.yml | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0bd89a150..22dcd7df2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: docker -name: mssql_test +name: api_test_mssql clone: disable: true @@ -22,7 +22,7 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v6 + image: chg80333/goadmin-test:v7 volumes: - name: data path: /go/src/github.com/GoAdminGroup/go-admin/tests/data @@ -31,8 +31,7 @@ steps: GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull -q - - git checkout -- go.mod go.sum + - git pull - git checkout $DRONE_COMMIT - sleep 80 - make ms-test @@ -40,7 +39,7 @@ steps: --- kind: pipeline type: docker -name: postgresql_test +name: api_test_postg clone: disable: true @@ -55,14 +54,13 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v6 + image: chg80333/goadmin-test:v7 environment: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull -q - - git checkout -- go.mod go.sum + - git pull - git checkout $DRONE_COMMIT - sleep 80 - make pg-test @@ -70,21 +68,20 @@ steps: --- kind: pipeline type: docker -name: sqlite_test +name: api_test_sqlit clone: disable: true steps: - name: api_test - image: chg80333/goadmin-test:v6 + image: chg80333/goadmin-test:v7 environment: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull -q - - git checkout -- go.mod go.sum + - git pull - git checkout $DRONE_COMMIT - sleep 80 - make sqlite-test @@ -92,7 +89,7 @@ steps: --- kind: pipeline type: docker -name: mysql_test +name: api_test_mysql clone: disable: true @@ -106,14 +103,35 @@ services: steps: - name: api_test - image: chg80333/goadmin-test:v6 + image: chg80333/goadmin-test:v7 environment: GO111MODULE: on GOPROXY: https://goproxy.cn commands: - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull -q - - git checkout -- go.mod go.sum + - git pull - git checkout $DRONE_COMMIT - sleep 80 - - make mysql-test \ No newline at end of file + - make mysql-test + +--- +kind: pipeline +type: docker +name: ui_test + +clone: + disable: true + +steps: +- name: api_test + image: chg80333/goadmin-test:v7 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn + commands: + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - git checkout $DRONE_COMMIT + - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & + - sleep 8 + - make web-test \ No newline at end of file From fae447d70d38214fad7647f51242be2059ec82ec Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 22:09:05 +0800 Subject: [PATCH 72/79] test(ci): update drone.yml --- .drone.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index 22dcd7df2..6d002c16c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: docker -name: api_test_mssql +name: api_mssql clone: disable: true @@ -21,7 +21,7 @@ services: SA_PASSWORD: Aa123456 steps: -- name: api_test +- name: api image: chg80333/goadmin-test:v7 volumes: - name: data @@ -39,7 +39,7 @@ steps: --- kind: pipeline type: docker -name: api_test_postg +name: api_postgres clone: disable: true @@ -53,7 +53,7 @@ services: POSTGRES_PASSWORD: root steps: -- name: api_test +- name: api image: chg80333/goadmin-test:v7 environment: GO111MODULE: on @@ -68,13 +68,13 @@ steps: --- kind: pipeline type: docker -name: api_test_sqlit +name: api_sqlite clone: disable: true steps: -- name: api_test +- name: api image: chg80333/goadmin-test:v7 environment: GO111MODULE: on @@ -89,7 +89,7 @@ steps: --- kind: pipeline type: docker -name: api_test_mysql +name: api_mysql clone: disable: true @@ -102,7 +102,7 @@ services: MYSQL_DATABASE: go-admin-test steps: -- name: api_test +- name: api image: chg80333/goadmin-test:v7 environment: GO111MODULE: on @@ -117,13 +117,13 @@ steps: --- kind: pipeline type: docker -name: ui_test +name: frontend_test clone: disable: true -steps: -- name: api_test +steps: +- name: chrome image: chg80333/goadmin-test:v7 environment: GO111MODULE: on From c83a1e9b0692b8bc051746a1e6a0ea319d4d228b Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 22:12:05 +0800 Subject: [PATCH 73/79] test(ci): update drone ci --- .drone.yml | 54 +++++++++++++++++++++++++------------------ tests/web/config.json | 2 +- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6d002c16c..c5d7cc859 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,3 +1,33 @@ + +--- +kind: pipeline +type: docker +name: frontend_test + +clone: + disable: true + +services: +- name: db_mysql + image: mysql:5.7 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: go-admin-test + +steps: +- name: chrome + image: chg80333/goadmin-test:v7 + environment: + GO111MODULE: on + GOPROXY: https://goproxy.cn + commands: + - cd /go/src/github.com/GoAdminGroup/go-admin + - git pull + - git checkout $DRONE_COMMIT + - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & + - sleep 8 + - make web-test + --- kind: pipeline type: docker @@ -112,26 +142,4 @@ steps: - git pull - git checkout $DRONE_COMMIT - sleep 80 - - make mysql-test - ---- -kind: pipeline -type: docker -name: frontend_test - -clone: - disable: true - -steps: -- name: chrome - image: chg80333/goadmin-test:v7 - environment: - GO111MODULE: on - GOPROXY: https://goproxy.cn - commands: - - cd /go/src/github.com/GoAdminGroup/go-admin - - git pull - - git checkout $DRONE_COMMIT - - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & - - sleep 8 - - make web-test \ No newline at end of file + - make mysql-test \ No newline at end of file diff --git a/tests/web/config.json b/tests/web/config.json index 6ae97033c..f560ee836 100644 --- a/tests/web/config.json +++ b/tests/web/config.json @@ -1,7 +1,7 @@ { "database": { "default": { - "host": "127.0.0.1", + "host": "db_mysql", "port": "3306", "user": "root", "pwd": "root", From d8b5926ae14a3736ea49a10becf43418a8ef297c Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 22:14:12 +0800 Subject: [PATCH 74/79] test(ci): update drone.yml --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c5d7cc859..d20f65b3b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,4 +1,3 @@ - --- kind: pipeline type: docker From 7e0778771dc9f5f384078275c419a1bede5a173d Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 22:29:14 +0800 Subject: [PATCH 75/79] test(ci): finally finish upgrade drone ci --- .drone.yml | 26 +++++++++++++------------- .travis.yml | 46 ---------------------------------------------- 2 files changed, 13 insertions(+), 59 deletions(-) delete mode 100644 .travis.yml diff --git a/.drone.yml b/.drone.yml index d20f65b3b..c537e1bde 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: docker -name: frontend_test +name: api_mysql clone: disable: true @@ -11,10 +11,10 @@ services: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test + MYSQL_DATABASE: go-admin-test -steps: -- name: chrome +steps: +- name: api image: chg80333/goadmin-test:v7 environment: GO111MODULE: on @@ -23,9 +23,8 @@ steps: - cd /go/src/github.com/GoAdminGroup/go-admin - git pull - git checkout $DRONE_COMMIT - - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & - - sleep 8 - - make web-test + - sleep 80 + - make mysql-test --- kind: pipeline @@ -118,7 +117,7 @@ steps: --- kind: pipeline type: docker -name: api_mysql +name: frontend clone: disable: true @@ -128,10 +127,10 @@ services: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: go-admin-test + MYSQL_DATABASE: go-admin-test -steps: -- name: api +steps: +- name: chrome image: chg80333/goadmin-test:v7 environment: GO111MODULE: on @@ -140,5 +139,6 @@ steps: - cd /go/src/github.com/GoAdminGroup/go-admin - git pull - git checkout $DRONE_COMMIT - - sleep 80 - - make mysql-test \ No newline at end of file + - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & + - sleep 8 + - make web-test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a44ade351..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: go -sudo: true - -go: - - 1.13.x - -env: - - GO111MODULE=on PGPASSWORD=root GOPROXY=https://goproxy.cn,https://goproxy.io,direct - -addons: - chrome: stable - apt: - packages: - - chromium-chromedriver - -services: - - mysql - - postgresql - - docker - -before_install: - - mysql -e 'create database `go-admin-test`;' - - createdb -U postgres go-admin-test - -install: - - wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/ - - unzip ~/chromedriver_linux64.zip -d ~/ - - rm ~/chromedriver_linux64.zip - - sudo chmod +x /home/travis/chromedriver - - ln --symbolic /home/travis/chromedriver "${HOME}/bin/chromedriver" - - chromedriver --version - -before_script: - - google-chrome-stable --version - - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & - - echo "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root - - psql -c "ALTER USER postgres WITH PASSWORD 'root';" -U postgres - - go get -u github.com/rakyll/gotest - - go get -u -v github.com/gogf/gf@v1.12.1 - - sudo chmod -R 777 $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - - sudo echo -e "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $GOPATH/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go - - docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Aa123456" -v /home/travis/gopath/src/github.com/GoAdminGroup/go-admin/tests/data:/home/data -p 1433:1433 --name mssql -d mcr.microsoft.com/mssql/server:2017-latest - - cd /home/travis/gopath/src/github.com/GoAdminGroup/go-admin && go get github.com/GoAdminGroup/themes@master - -script: - - cd /home/travis/gopath/src/github.com/GoAdminGroup/go-admin && make test \ No newline at end of file From 7309bc0149cacde9e23272a72047d41ef92c5293 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 23:04:33 +0800 Subject: [PATCH 76/79] test(ci): update drone ci --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 836cfb46a..b1bacaebb 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@

- Go Report Card + Go Report Card Go Report Card golang telegram diff --git a/README_CN.md b/README_CN.md index 3249d7d8c..cab8e43f0 100644 --- a/README_CN.md +++ b/README_CN.md @@ -7,7 +7,7 @@ 遗失的Golang编写的数据可视化与管理平台构建框架

-Go Report Card +Go Report Card Go Report Card golang telegram From b888a60a4ece55465f5811b1f9620fdb4d1aefbd Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 23:11:55 +0800 Subject: [PATCH 77/79] test(ci): update drone ci --- .drone.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.drone.yml b/.drone.yml index c537e1bde..dae97b116 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,6 +3,10 @@ kind: pipeline type: docker name: api_mysql +trigger: + event: + - pull_request + clone: disable: true @@ -31,6 +35,10 @@ kind: pipeline type: docker name: api_mssql +trigger: + event: + - pull_request + clone: disable: true @@ -69,6 +77,10 @@ kind: pipeline type: docker name: api_postgres +trigger: + event: + - pull_request + clone: disable: true @@ -98,6 +110,10 @@ kind: pipeline type: docker name: api_sqlite +trigger: + event: + - pull_request + clone: disable: true @@ -119,6 +135,10 @@ kind: pipeline type: docker name: frontend +trigger: + event: + - pull_request + clone: disable: true From b1ac7b446ff1ad8d4777c666e376f1e0d86e4168 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 23:17:02 +0800 Subject: [PATCH 78/79] test(ci): update README --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1bacaebb..59c924130 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@

- Go Report Card + Build Status Go Report Card golang telegram diff --git a/README_CN.md b/README_CN.md index cab8e43f0..5f8985735 100644 --- a/README_CN.md +++ b/README_CN.md @@ -7,7 +7,7 @@ 遗失的Golang编写的数据可视化与管理平台构建框架

-Go Report Card +Build Status Go Report Card golang telegram From db3d5163ccc00c9e877e1558a8118509b9d5e6a0 Mon Sep 17 00:00:00 2001 From: cg33 Date: Tue, 1 Jun 2021 23:22:37 +0800 Subject: [PATCH 79/79] test(ci): update ui test --- tests/web/web_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/web/web_test.go b/tests/web/web_test.go index 9181572a3..0c6f5ab32 100644 --- a/tests/web/web_test.go +++ b/tests/web/web_test.go @@ -530,7 +530,7 @@ func testEditPageOperations(page *Page) { page.Value(birthdayField, "2010-09-05 00:00:00") page.Value(passwordField, "12345678") page.Value(ipField, "127.0.0.1") - page.Value(amountField, "15.00") + page.Value(amountField, "15") page.Click(selectTab)