forked from simagix/mongo-go-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·20 lines (17 loc) · 695 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash
# Copyright 2018 Kuei-chun Chen. All rights reserved.
echo ; echo "Spin up mongod"
mongod --version
mkdir -p data/db
rm -rf data/db/*
mongod --port 30097 --dbpath data/db --logpath data/mongod.log --fork --wiredTigerCacheSizeGB .5 --replSet replset
mongo --quiet mongodb://localhost:30097/admin --eval 'rs.initiate()'
sleep 2
# Case 1: prints all oplogs
# Case 2: print only updates
# '[{"$match": {"operationType": "update"}}]'
export DATABASE_URL="mongodb://localhost:30097/argos?replicaSet=replset"
GOCACHE=off go test ./... -v -short
echo ; echo "Shutdown mongod"
mongo --quiet --port 30097 --eval 'db.getSisterDB("admin").shutdownServer()' > /dev/null 2>&1
rm -rf data/*