add some testing scripts
This commit is contained in:
parent
7e3703d83e
commit
4dca2287ff
13
scripts/adapter.sh
Normal file
13
scripts/adapter.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# using pkg/adapter. Usually you want to migrate to V2 smoothly, you could running this script
|
||||
|
||||
find ./ -name '*.go' -type f -exec sed -i '' -e 's/github.com\/astaxie\/beego/github.com\/astaxie\/beego\/pkg\/adapter/g' {} \;
|
||||
find ./ -name '*.go' -type f -exec sed -i '' -e 's/"github.com\/astaxie\/beego\/pkg\/adapter"/beego "github.com\/astaxie\/beego\/pkg\/adapter"/g' {} \;
|
||||
|
||||
update rrp_flow set status = 4 where flow_id in (5623711176,5629411891)
|
||||
|
||||
select * from rrp_flow where flow_id in (5623711176,5629411891) and status = 5
|
||||
|
||||
update rrp_flow set status = 5 where flow_id in (5623711176,5629411891)
|
||||
|
||||
8
scripts/prepare_etcd.sh
Normal file
8
scripts/prepare_etcd.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
etcdctl put current.float 1.23
|
||||
etcdctl put current.bool true
|
||||
etcdctl put current.int 11
|
||||
etcdctl put current.string hello
|
||||
etcdctl put current.serialize.name test
|
||||
etcdctl put sub.sub.key1 sub.sub.key
|
||||
17
scripts/test.sh
Normal file
17
scripts/test.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker-compose -f "$(pwd)/scripts/test_docker_compose.yaml" up -d
|
||||
|
||||
export ORM_DRIVER=mysql
|
||||
export TZ=UTC
|
||||
export ORM_SOURCE="beego:test@tcp(localhost:13306)/orm_test?charset=utf8"
|
||||
|
||||
# wait for services in images ready
|
||||
sleep 5
|
||||
|
||||
go test "$(pwd)/..."
|
||||
|
||||
# clear all container
|
||||
docker-compose -f "$(pwd)/scripts/test_docker_compose.yaml" down
|
||||
|
||||
|
||||
55
scripts/test_docker_compose.yaml
Normal file
55
scripts/test_docker_compose.yaml
Normal file
@ -0,0 +1,55 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
redis:
|
||||
container_name: "beego-redis"
|
||||
image: redis
|
||||
environment:
|
||||
- ALLOW_EMPTY_PASSWORD=yes
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
mysql:
|
||||
container_name: "beego-mysql"
|
||||
image: mysql:5.7.30
|
||||
ports:
|
||||
- "13306:3306"
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=1q2w3e
|
||||
- MYSQL_DATABASE=orm_test
|
||||
- MYSQL_USER=beego
|
||||
- MYSQL_PASSWORD=test
|
||||
|
||||
postgresql:
|
||||
container_name: "beego-postgresql"
|
||||
image: bitnami/postgresql:latest
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- ALLOW_EMPTY_PASSWORD=yes
|
||||
ssdb:
|
||||
container_name: "beego-ssdb"
|
||||
image: wendal/ssdb
|
||||
ports:
|
||||
- "8888:8888"
|
||||
memcache:
|
||||
container_name: "beego-memcache"
|
||||
image: memcached
|
||||
ports:
|
||||
- "11211:11211"
|
||||
etcd:
|
||||
command: >
|
||||
sh -c "
|
||||
etcdctl put current.float 1.23
|
||||
&& etcdctl put current.bool true
|
||||
&& etcdctl put current.int 11
|
||||
&& etcdctl put current.string hello
|
||||
&& etcdctl put current.serialize.name test
|
||||
"
|
||||
container_name: "beego-etcd"
|
||||
environment:
|
||||
- ALLOW_NONE_AUTHENTICATION=yes
|
||||
# - ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
|
||||
image: bitnami/etcd
|
||||
ports:
|
||||
- "2379:2379"
|
||||
- "2380:2380"
|
||||
Loading…
x
Reference in New Issue
Block a user