Skip to content

Commit

Permalink
Small fixes to get the integration tests working on Github Actions, a…
Browse files Browse the repository at this point in the history
…dding the tests to pull_requests (opensearch-project#130)

* Small fixes to get the integration tests working on Github Actions, adding the tests to pull_requests

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Checking if parameter is set before calling build.sh functions with a parameter

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Give variable default value of empty if unset to prevent failing on unset variables

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Rename OSBenchmark to OpenSearch Benchmark in tox.ini

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Removing branching based on parameters in favor of using  in build.sh

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>
  • Loading branch information
engechas authored Feb 25, 2022
1 parent 2915ded commit 069c6aa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
13 changes: 10 additions & 3 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,31 @@ function build_it {
export PATH="$HOME/.pyenv/bin:$PATH"
export TERM=dumb
export LC_ALL=en_US.UTF-8
export BENCHMARK_HOME=$WORKSPACE
export BENCHMARK_HOME="$GITHUB_WORKSPACE"
export JAVA_PATH="/opt/hostedtoolcache/Java_Adopt_jdk"
export JAVA_HOME="$JAVA_PATH/15.0.2-7/x64"
export JAVA8_HOME="$JAVA_PATH/8.0.292-1/x64"
export JAVA11_HOME="$JAVA_PATH/11.0.11-9/x64"
export JAVA15_HOME="$JAVA_PATH/15.0.2-7/x64"
export JAVA16_HOME="$JAVA_PATH/16.0.2-7/x64"

update_pyenv
eval "$(pyenv init -)"
# ensure pyenv shims are added to PATH, see https://github.com/pyenv/pyenv/issues/1906
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
pip install opensearch-benchmark
docker pull datadog/squid:latest

make prereq
make install
make precommit
make it

if [[ "$1" == "Python_3.8" ]]; then
make it38
elif [[ "$1" == "Python_3.9" ]]; then
make it39
fi
}

function license-scan {
Expand Down Expand Up @@ -118,7 +125,7 @@ function archive {
}

if declare -F "$1" > /dev/null; then
$1
"$@"
exit
else
echo "Please specify a function to run"
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/manual-integ.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Integ Actions
on: [workflow_dispatch]
on: [workflow_dispatch, pull_request]
jobs:
Integration-Tests:
strategy:
matrix:
python-version:
- Python_3.8
- Python_3.9
runs-on: ubuntu-latest
steps:
- name: Check out repository code
Expand All @@ -23,7 +28,12 @@ jobs:
with:
distribution: 'adopt'
java-version: '15'
- name: Install JDK 16
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'
- name: Run the CI build_it script
run: bash .ci/build.sh build_it
run: bash .ci/build.sh build_it ${{ matrix.python-version }}
env:
BENCHMARK_HOME: env.GITHUB_WORKSPACE
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###############################################################################
#
# tox configuration for OSBenchmark.
# tox configuration for OpenSearch Benchmark.
#
# Invocation: Run `make it`
#
Expand Down Expand Up @@ -38,7 +38,6 @@ setenv =
# applications behave identically, we also set LANG explicitly.
LANG=C
commands =
pytest --junitxml=junit-{envname}.xml
pytest -s it --junitxml=junit-{envname}-it.xml

whitelist_externals =
Expand Down

0 comments on commit 069c6aa

Please sign in to comment.