Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

jobs:
build-test:
strategy:
fail-fast: false
matrix:
protocol: [http, non_http]

runs-on:
- benchmark
Expand All @@ -30,6 +34,7 @@ jobs:

- name: Build and Run Tests
env:
TEST_PROTOCOL: ${{ matrix.protocol }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -66,4 +71,3 @@ jobs:
LENZ_TAG: dev
run: BUILD_COMPLETE=true ./ci.sh
shell: bash

5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
protocol: [http, non_http]

runs-on:
- benchmark
Expand All @@ -30,6 +34,7 @@ jobs:

- name: Build and Run Tests
env:
TEST_PROTOCOL: ${{ matrix.protocol }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

jobs:
run_test:
strategy:
fail-fast: false
matrix:
protocol: [http, non_http]

runs-on:
- gcp
Expand Down Expand Up @@ -34,11 +38,12 @@ jobs:

- name: Build and Run Tests
env:
TEST_PROTOCOL: ${{ matrix.protocol }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
RUNNER_NAME: ${{ runner.name }}
RUNNER_NAME: ${{ runner.name }}_${{ matrix.protocol }}
RUN_TESTS: true
NO_PUSH: true
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

jobs:
build-test:
strategy:
fail-fast: false
matrix:
protocol: [http, non_http]

runs-on:
- self-hosted
Expand Down Expand Up @@ -35,10 +39,12 @@ jobs:

- name: Build and Run Tests
env:
TEST_PROTOCOL: ${{ matrix.protocol }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
RUNNER_NAME: ${{ runner.name }}_${{ matrix.protocol }}
run: RUN_TESTS=true NO_PUSH=true UPDATE_BRANCH=true ./ci.sh
shell: bash

Expand All @@ -64,4 +70,4 @@ jobs:

- name: Build Notebook Docker
run: BUILD_COMPLETE=true NO_PUSH=true ./ci.sh
shell: bash
shell: bash
100 changes: 61 additions & 39 deletions test/run_test_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ function run_aperturedb_instance(){

IP_REGEX='[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'

GATEWAY_HTTP=$(run_aperturedb_instance "${RUNNER_NAME}_http" | grep $IP_REGEX )
GATEWAY_NON_HTTP=$(run_aperturedb_instance "${RUNNER_NAME}_non_http" | grep $IP_REGEX )
# Check if TEST_PROTOCOL is set, otherwise default to both
TEST_PROTOCOL=${TEST_PROTOCOL:-"both"}

if [ "$TEST_PROTOCOL" == "http" ] || [ "$TEST_PROTOCOL" == "both" ]; then
GATEWAY_HTTP=$(run_aperturedb_instance "${RUNNER_NAME}_http" | grep $IP_REGEX )
fi

if [ "$TEST_PROTOCOL" == "non_http" ] || [ "$TEST_PROTOCOL" == "both" ]; then
GATEWAY_NON_HTTP=$(run_aperturedb_instance "${RUNNER_NAME}_non_http" | grep $IP_REGEX )
fi

# The LOG_PATH and RUNNER_INFO_PATH are set to the current working directory
LOG_PATH="$(pwd)/aperturedb/logs"
Expand All @@ -48,42 +56,57 @@ fi

sleep 20 # wait for the containers to be up and running

echo "running tests on docker image $REPOSITORY with $GATEWAY_HTTP and $GATEWAY_NON_HTTP"
docker run \
-v $(pwd)/output:/aperturedata/test/output \
-v $(pwd)/${RUNNER_NAME}_http_ca:/ca \
--network=${RUNNER_NAME}_http_default \
-v "$LOG_PATH":"${TESTING_LOG_PATH}" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e GCP_SERVICE_ACCOUNT_KEY="$GCP_SERVICE_ACCOUNT_KEY" \
-e APERTUREDB_LOG_PATH="${TESTING_LOG_PATH}" \
-e GATEWAY="nginx" \
-e FILTER="http" \
$REPOSITORY &

pid1=$!
docker run \
-v $(pwd)/output:/aperturedata/test/output \
-v $(pwd)/${RUNNER_NAME}_non_http_ca:/ca \
--network=${RUNNER_NAME}_non_http_default \
-v "$LOG_PATH":"${TESTING_LOG_PATH}" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e GCP_SERVICE_ACCOUNT_KEY="$GCP_SERVICE_ACCOUNT_KEY" \
-e APERTUREDB_LOG_PATH="${TESTING_LOG_PATH}" \
-e GATEWAY="lenz" \
-e FILTER="not http" \
$REPOSITORY &

pid2=$!

wait $pid1
exit_code1=$?
wait $pid2
exit_code2=$?
pid1=0
pid2=0

if [ "$TEST_PROTOCOL" == "http" ] || [ "$TEST_PROTOCOL" == "both" ]; then
echo "running tests on docker image $REPOSITORY with $GATEWAY_HTTP"
docker run \
-v $(pwd)/output:/aperturedata/test/output \
-v $(pwd)/${RUNNER_NAME}_http_ca:/ca \
--network=${RUNNER_NAME}_http_default \
-v "$LOG_PATH":"${TESTING_LOG_PATH}" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e GCP_SERVICE_ACCOUNT_KEY="$GCP_SERVICE_ACCOUNT_KEY" \
-e APERTUREDB_LOG_PATH="${TESTING_LOG_PATH}" \
-e GATEWAY="nginx" \
-e FILTER="http" \
$REPOSITORY &
pid1=$!
fi

if [ "$TEST_PROTOCOL" == "non_http" ] || [ "$TEST_PROTOCOL" == "both" ]; then
echo "running tests on docker image $REPOSITORY with $GATEWAY_NON_HTTP"
docker run \
-v $(pwd)/output:/aperturedata/test/output \
-v $(pwd)/${RUNNER_NAME}_non_http_ca:/ca \
--network=${RUNNER_NAME}_non_http_default \
-v "$LOG_PATH":"${TESTING_LOG_PATH}" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e GCP_SERVICE_ACCOUNT_KEY="$GCP_SERVICE_ACCOUNT_KEY" \
-e APERTUREDB_LOG_PATH="${TESTING_LOG_PATH}" \
-e GATEWAY="lenz" \
-e FILTER="not http" \
$REPOSITORY &
pid2=$!
fi

exit_code1=0
exit_code2=0

if [ "$pid1" != "0" ]; then
wait $pid1
exit_code1=$?
fi

if [ "$pid2" != "0" ]; then
wait $pid2
exit_code2=$?
fi

if [ $exit_code1 -ne 0 ]; then
echo "Tests failed for HTTP"
Expand All @@ -94,7 +117,6 @@ if [ $exit_code2 -ne 0 ]; then
exit $exit_code2
fi


echo "Tests completed"
echo " --- Runner name: ${RUNNER_NAME} ---"
check_containers_networks
Loading