Skip to content

Commit

Permalink
add Tendis tests to CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil-crow committed Jan 19, 2021
1 parent fdbc017 commit 9b90491
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 12 deletions.
68 changes: 60 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
cpplint-check:
name: cpplint check
name: Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: prepare env
- name: Prepare Env
run: |
python -m pip install --upgrade pip
pip install cpplint
export PATH=$PATH:~/.local/bin/
cpplint --version
- name: lint
- name: Lint
run: |
export PATH=$PATH:~/.local/bin/
files=`git diff --name-only HEAD HEAD~1`
Expand All @@ -47,20 +47,72 @@ jobs:
fi
done
build:
build-test:
needs: [cpplint-check]
name: build
name: Build-Test
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: init submodules
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Set Up TCL
run: sudo apt-get install tcl8.5
- name: Init Submodules
run: |
git submodule update --init --recursive
- name: build Tendis
- name: Build
run: |
mkdir build && cd build
cmake ..
cmake --build . -j2
cmake --build . -j2
- name: Restore Test
run: |
cd build/bin
./restore_test --gtest_throw_on_failure
shell: bash
- name: Repl Test
run: |
cd build/bin
./repl_test --gtest_throw_on_failure
shell: bash
- name: Cluster Test
run: |
cd build/bin
./cluster_test --gtest_throw_on_failure
shell: bash
- name: Unit Test
run: |
bash unittest.sh
errcnt1=`grep -E "Expected|FAILED" unittest.log |wc -l`
if [ $errcnt1 -ne 0 ]; then
echo "really xxx judge"
grep -E "Expected|FAILED" unittest.log
exit $errcnt1
fi
shell: bash
- name: Redis Test
run: |
bash redistest.sh | tee temp_redistest.log
errcnt2=`grep -E "\[err|\[exception|49merr|49mexception" redistest.log|wc -l`
if [ $errcnt2 -ne 0 ]; then
grep -E "\[err|\[exception|49merr|49mexception" redistest.log
fi
exit $errcnt2
shell: bash
- name: GoTest
run: |
cd src/tendisplus/integrate_test
bash ./gotest.sh | tee go-test2.log
cd -
errcnt2=`grep "go passed" src/tendisplus/integrate_test/gotest.log|wc -l`
if [ $errcnt2 -ne 6 ]; then
grep "fatal" src/tendisplus/integrate_test/gotest.log
grep "go passed" src/tendisplus/integrate_test/gotest.log
exit $errcnt2
fi
shell: bash
2 changes: 1 addition & 1 deletion mkreleasehdr.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l`
BUILD_ID=`uname -n`"-"`date +%s`
Expand Down
2 changes: 1 addition & 1 deletion redis_cluster_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
tclsh tests/cluster/run.tcl --single 00-base.tcl
tclsh tests/cluster/run.tcl --single 01-faildet.tcl
tclsh tests/cluster/run.tcl --single 02-failover.tcl
Expand Down
1 change: 1 addition & 0 deletions redistest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
logfile=./redistest.log
rm $logfile

Expand Down
1 change: 1 addition & 0 deletions src/tendisplus/integrate_test/gotest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
logfile="gotest.log"

rm -f $logfile
Expand Down
2 changes: 1 addition & 1 deletion testall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

sh ./unittest.sh >&unittest.log &

Expand Down
2 changes: 1 addition & 1 deletion unittest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

logfile=./unittest.log
rm $logfile
Expand Down

0 comments on commit 9b90491

Please sign in to comment.