This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
system tests #11811
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: system tests | |
on: | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '43 */4 * * *' | |
jobs: | |
system: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.16 | |
- name: check out | |
uses: actions/checkout@v2 | |
- name: build | |
run: script/test-build | |
- name: clone orchestrator-ci-env | |
run: | | |
# Only clone if not already running locally at latest commit | |
remote_commit=$(git ls-remote https://github.com/openark/orchestrator-ci-env.git HEAD | cut -f1) | |
local_commit="unknown" | |
[ -d "orchestrator-ci-env" ] && local_commit=$(cd orchestrator-ci-env && git log --format="%H" -n 1) | |
echo "remote commit is: $remote_commit" | |
echo "local commit is: $local_commit" | |
if [ "$remote_commit" != "$local_commit" ] ; then | |
rm -rf ./orchestrator-ci-env | |
git clone https://github.com/openark/orchestrator-ci-env.git | |
fi | |
- name: apt-get update | |
run: | | |
sudo apt-get update | |
- name: deploy orchestrator-ci-env | |
run: | | |
cd orchestrator-ci-env | |
script/deploy-haproxy | |
script/run-haproxy | |
script/deploy-consul | |
script/run-consul | |
script/deploy-consul-template | |
script/run-consul-template | |
script/deploy-replication | |
script/deploy-heartbeat | |
script/run-heartbeat | |
- name: deploy orchestrator as service | |
run: | | |
sudo cp etc/systemd/orchestrator.service /etc/systemd/system/ | |
sudo mkdir -p /usr/local/orchestrator | |
sudo cp bin/orchestrator /usr/local/orchestrator/ | |
sudo cp resources/bin/orchestrator-client /usr/bin | |
sudo cp tests/system/orchestrator-ci-system.conf.json /etc/orchestrator.conf.json | |
- name: reload systemctl | |
run: | | |
sudo systemctl daemon-reload | |
- name: run orchestrator service | |
run: | | |
sudo systemctl start orchestrator | |
- name: test services | |
run: | | |
sudo systemctl status orchestrator | |
- name: orchestrator-client status | |
run: | | |
orchestrator-client -c api -path status | jq . | |
- name: graceful sleep | |
run: | | |
echo "Sleeping gracefully to let orchestrator detect the topology" | |
sleep 20 | |
- name: orchestrator-client cluster | |
run: | | |
orchestrator-client -c clusters-alias | |
orchestrator-client -c all-instances | |
orchestrator-client -c topology-tabulated -alias ci | |
orchestrator-client -c replication-analysis | |
- name: get consul KV values | |
run: | | |
consul kv get -recurse mysql/master | |
- name: system tests | |
run: script/test-system |