Skip to content

Commit

Permalink
feat: add integrate test (#1)
Browse files Browse the repository at this point in the history
 add integrate test
  • Loading branch information
luky116 authored May 19, 2023
1 parent 8474b97 commit 4b6f029
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,22 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

- name: Start Pika
run: cd ${{github.workspace}} && cd build/ && make && ls -l && cd .. && chmod +x ./build/pika && ./build/pika -c ./conf/pika.conf

- name: Integration Testing
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
chmod +x integrate_test.sh \
&& [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] \
&& [[ -n "${{github.event.pull_request.head.sha}}" ]] \
&& [[ -n "${{github.base_ref}}" ]] \
&& ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}}
elif [ "$GITHUB_EVENT_NAME" == "push" ]; then
chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
else
echo "$GITHUB_EVENT_NAME is an unsupported event type."
exit 1
fi
3 changes: 1 addition & 2 deletions conf/pika.conf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ consensus-level : 0
dump-prefix :

# daemonize [yes | no].
#daemonize : yes
daemonize : yes

# The directory to stored dump files that generated by command "bgsave".
dump-path : ./dump/
Expand Down Expand Up @@ -387,4 +387,3 @@ max-bytes-for-level-multiplier : 10
# blob-num-shard-bits default -1, the number of bits from cache keys to be use as shard id.
# The cache will be sharded into 2^blob-num-shard-bits shards.
# blob-num-shard-bits : -1

42 changes: 42 additions & 0 deletions integrate_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -e
set -x

echo 'start integrate-test'

# set root workspace
ROOT_DIR=$(pwd)
echo "integrate-test root work-space -> ${ROOT_DIR}"

# show all github-env
echo "github current commit id -> $2"
echo "github pull request branch -> ${GITHUB_REF}"
echo "github pull request slug -> ${GITHUB_REPOSITORY}"
echo "github pull request repo slug -> ${GITHUB_REPOSITORY}"
echo "github pull request actor -> ${GITHUB_ACTOR}"
echo "github pull request repo param -> $1"
echo "github pull request base branch -> $3"
echo "github pull request head branch -> ${GITHUB_HEAD_REF}"

git clone -b master https://github.com/luky116/pika-integration.git pika-integration && cd pika-integration

chmod +x ./start_integrate_test.sh
# start integrate test
./start_integrate_test.sh

0 comments on commit 4b6f029

Please sign in to comment.