Skip to content

Integration tests for sigopt/sigopt-python@refs/heads/main #396

Integration tests for sigopt/sigopt-python@refs/heads/main

Integration tests for sigopt/sigopt-python@refs/heads/main #396

Workflow file for this run

name: integration tests
run-name: Integration tests for ${{ github.repository }}@${{ github.ref }}
on:
push: {}
schedule:
- cron: "0 8,16 * * *"
jobs:
integration-test:
runs-on: ubuntu-latest
env:
SIGOPT_PROJECT: hyperopt-integration-test
SIGOPT_API_URL: https://sigopt.ninja:4443/api
SIGOPT_API_VERIFY_SSL_CERTS: /home/runner/work/sigopt-python/sigopt-server/artifacts/tls/root-ca.crt
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo '127.0.0.1 sigopt.ninja' | sudo tee -a /etc/hosts
- run: git clone https://github.com/sigopt/sigopt-server ../sigopt-server
- run: |
cd ../sigopt-server
git checkout main
EDITOR=true ./setup.sh | tee setup_output.log
./start.sh &
- run: |
cd ../sigopt-server
./ci/wait_for.sh url "$SIGOPT_API_URL/health"
- run: |
EMAIL="$(tail -n 2 ../sigopt-server/setup_output.log | grep -E '^ email:' | awk -F': ' '{ print $2 }')"
PASSWORD="$(tail -n 2 ../sigopt-server/setup_output.log | grep -E '^ password:' | awk -F': ' '{ print $2 }')"
curl -fsk -XPOST "$SIGOPT_API_URL/v1/sessions" -d '{"email": "'"$EMAIL"'", "password": "'"$PASSWORD"'"}' | \
jq -r .api_token.token >sigopt_user_token.txt
curl -fsk --user "$(cat sigopt_user_token.txt):" "$SIGOPT_API_URL/v1/clients/1/tokens" | \
jq -r '.data[] | select(.token_type == "client-api") | .token' >sigopt_api_token.txt
- run: pip install '.[dev]'
- run: sudo apt-get update && sudo apt-get -y install default-jre
- run: docker run -p 27017:27017 -d mongo:5.0.6
- run: hyperopt-mongo-worker --mongo=localhost:27017/foo_db --poll-interval=0.1 --max-consecutive-failures=100000 &>/dev/null &
- run: env SIGOPT_API_TOKEN="$(cat sigopt_api_token.txt)" sigopt create project
- name: Integration tests
run: env SIGOPT_API_TOKEN="$(cat sigopt_api_token.txt)" pytest -rw -v integration_test/
tutorial:
runs-on: ubuntu-latest
env:
SIGOPT_PROJECT: tutorial
SIGOPT_API_URL: https://sigopt.ninja:4443/api
SIGOPT_API_VERIFY_SSL_CERTS: /home/runner/work/sigopt-python/sigopt-server/artifacts/tls/root-ca.crt
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: sudo apt-get install -yqq expect
- run: echo '127.0.0.1 sigopt.ninja' | sudo tee -a /etc/hosts
- run: git clone https://github.com/sigopt/sigopt-server ../sigopt-server
- run: |
cd ../sigopt-server
git checkout main
EDITOR=true ./setup.sh | tee setup_output.log
./start.sh &
- run: |
cd ../sigopt-server
./ci/wait_for.sh url "$SIGOPT_API_URL/health"
- run: |
EMAIL="$(tail -n 2 ../sigopt-server/setup_output.log | grep -E '^ email:' | awk -F': ' '{ print $2 }')"
PASSWORD="$(tail -n 2 ../sigopt-server/setup_output.log | grep -E '^ password:' | awk -F': ' '{ print $2 }')"
curl -fsk -XPOST "$SIGOPT_API_URL/v1/sessions" -d '{"email": "'"$EMAIL"'", "password": "'"$PASSWORD"'"}' | \
jq -r .api_token.token >sigopt_user_token.txt
curl -fsk --user "$(cat sigopt_user_token.txt):" "$SIGOPT_API_URL/v1/clients/1/tokens" | \
jq -r '.data[] | select(.token_type == "client-api") | .token' >sigopt_api_token.txt
- run: pip install '.[xgboost]' scikit-learn
- run: env SIGOPT_API_TOKEN="$(cat sigopt_api_token.txt)" sigopt create project
- run: env TEST_ACCOUNT_API_TOKEN="$(cat sigopt_api_token.txt)" ./ci/tutorial/sigopt_config.exp
- run: sigopt run python ./ci/tutorial/model.py