Skip to content

Commit cc56d69

Browse files
authored
Merge pull request #55 from pj8/prevent-output
Prevent output on install
2 parents 1d3f0c1 + 51a2c3b commit cc56d69

File tree

6 files changed

+66
-49
lines changed

6 files changed

+66
-49
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,15 @@ name: Test
33
on: push
44

55
jobs:
6-
test-macos:
6+
test:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
os: [macos-latest]
10+
os: [macos-latest, ubuntu-latest]
11+
test_script: [mongodb-test.sh, mysql-test.sh, postgresql-12-test.sh, postgresql-13-test.sh, redis-test.sh]
1112
steps:
1213
- uses: actions/checkout@v3
13-
- name: Run mongodb test
14+
- name: Run test
1415
run: |
1516
cd tests
16-
/bin/bash mongodb-test.sh
17-
- name: Run mysql test
18-
run: |
19-
cd tests
20-
/bin/bash mysql-test.sh
21-
- name: Run postgresql test
22-
run: |
23-
cd tests
24-
/bin/bash postgresql-test.sh
25-
- name: Run redis test
26-
run: |
27-
cd tests
28-
/bin/bash redis-test.sh
29-
test-ubuntu:
30-
runs-on: ${{ matrix.os }}
31-
strategy:
32-
matrix:
33-
os: [ubuntu-latest]
34-
steps:
35-
- uses: actions/checkout@v3
36-
- name: Run mongodb test
37-
run: |
38-
cd tests
39-
/bin/bash mongodb-test.sh
40-
- name: Run mysql test
41-
run: |
42-
cd tests
43-
/bin/bash mysql-test.sh
44-
- name: Run postgresql test
45-
run: |
46-
cd tests
47-
/bin/bash postgresql-test.sh
48-
- name: Run redis test
49-
run: |
50-
cd tests
51-
/bin/bash redis-test.sh
17+
/bin/bash ${{ matrix.test_script }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.2.11
1+
v1.2.12

postgresql/create.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ if [ ! -d $dir/basedir/bin ]; then
5959
if [ $os = "linux" ]; then
6060
echo "Installing..." 1>&2
6161
cd $dir/basedir
62-
./configure --prefix=$(pwd) 1>&2
63-
make 1>&2
64-
make install 1>&2
62+
./configure --prefix=$(pwd) > /dev/null 2>&1
63+
make > /dev/null 2>&1
64+
make install > /dev/null 2>&1
6565
rm -fr config contrib doc src
6666
fi
6767
fi

redis/create.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ extractFile $dir $optFileName
5555

5656
if [ ! -e $dir/basedir/src/redis-server ]; then
5757
cd $dir/basedir
58-
make 1>&2
58+
echo "Installing..." 1>&2
59+
make > /dev/null 2>&1
5960
fi
6061

6162
# create redis.conf

tests/postgresql-test.sh renamed to tests/postgresql-12-test.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ set -aeuvx
44
. ../lib/functions.sh
55

66
type=postgresql
7-
oldVersion=12.4
8-
newVersion=13.2
7+
version=12.4
98

109
cd ../$type
1110
rm -fr $type-*.tar.gz
@@ -17,7 +16,7 @@ md5="md5"
1716
hash=$(echo "dbdb-$date" | $md5 | cut -d ' ' -f 1)
1817

1918
echo "Test create"
20-
./$type/create.sh dbdb-test-$hash $oldVersion random
19+
./$type/create.sh dbdb-test-$hash $version random
2120
echo "Test port"
2221
./$type/port.sh dbdb-test-$hash
2322
echo "Test start"
@@ -32,7 +31,7 @@ echo "Test delete"
3231
./$type/delete.sh dbdb-test-$hash
3332

3433
echo "Test create"
35-
./$type/create.sh -f json dbdb-test-$hash $newVersion random | jq
34+
./$type/create.sh -f json dbdb-test-$hash $version random | jq
3635
echo "Test port"
3736
./$type/port.sh -f json dbdb-test-$hash | jq
3837
echo "Test start"
@@ -47,6 +46,6 @@ echo "Test delete"
4746
./$type/delete.sh -f json dbdb-test-$hash | jq
4847

4948
./dbdb.sh
50-
./$type/create-start.sh -f json dbdb-test-$hash $newVersion random | jq
49+
./$type/create-start.sh -f json dbdb-test-$hash $version random | jq
5150
./dbdb.sh -f json | jq
5251
./$type/delete.sh dbdb-test-$hash

tests/postgresql-13-test.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
set -aeuvx
3+
4+
. ../lib/functions.sh
5+
6+
type=postgresql
7+
version=13.2
8+
9+
cd ../$type
10+
rm -fr $type-*.tar.gz
11+
cd ..
12+
13+
date=$(date +%Y%m%d%H%M%S)
14+
md5="md5"
15+
[ "$(getOS)" = "linux" ] && md5="md5sum"
16+
hash=$(echo "dbdb-$date" | $md5 | cut -d ' ' -f 1)
17+
18+
echo "Test create"
19+
./$type/create.sh dbdb-test-$hash $version random
20+
echo "Test port"
21+
./$type/port.sh dbdb-test-$hash
22+
echo "Test start"
23+
./$type/start.sh dbdb-test-$hash
24+
echo "Test status"
25+
./$type/status.sh dbdb-test-$hash
26+
echo "Test restart"
27+
./$type/restart.sh dbdb-test-$hash
28+
echo "Test stop"
29+
./$type/stop.sh dbdb-test-$hash
30+
echo "Test delete"
31+
./$type/delete.sh dbdb-test-$hash
32+
33+
echo "Test create"
34+
./$type/create.sh -f json dbdb-test-$hash $version random | jq
35+
echo "Test port"
36+
./$type/port.sh -f json dbdb-test-$hash | jq
37+
echo "Test start"
38+
./$type/start.sh -f json dbdb-test-$hash | jq
39+
echo "Test status"
40+
./$type/status.sh -f json dbdb-test-$hash | jq
41+
echo "Test restart"
42+
./$type/restart.sh -f json dbdb-test-$hash | jq
43+
echo "Test stop"
44+
./$type/stop.sh -f json dbdb-test-$hash | jq
45+
echo "Test delete"
46+
./$type/delete.sh -f json dbdb-test-$hash | jq
47+
48+
./dbdb.sh
49+
./$type/create-start.sh -f json dbdb-test-$hash $version random | jq
50+
./dbdb.sh -f json | jq
51+
./$type/delete.sh dbdb-test-$hash

0 commit comments

Comments
 (0)