getting node deployed; first test

This commit is contained in:
pokeeffe-molecula 2022-01-04 20:55:23 -06:00
parent 2f68b2a6f6
commit f5b669508b
5 changed files with 31 additions and 1 deletions

1
.gitignore vendored
View file

@ -18,3 +18,4 @@ pilosa
launch.json
.terraform.lock.hcl
__pycache__/
report.xml

View file

@ -29,7 +29,7 @@ do
break
echo "Cluster is up after $${i} tries."
fi
sleep 20
sleep 10
done

View file

@ -7,6 +7,22 @@ echo "using bastion ${BASTION}"
NODE=$(cat ./qa/tf/ci/smoketest/outputs.json | jq -r '[.data_node_ips][0]["value"][0]')
echo "using node ${NODE}"
echo "Copying tests to remote"
scp -r -i ~/.ssh/gitlab-featurebase-ci.pem ./qa/testcases/smoketest ec2-user@${BASTION}:/data
if (( $? != 0 ))
then
echo "Copy failed"
exit 1
fi
# run smoke test
echo "Running smoke test..."
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${BASTION} " pushd /data; pytest --junitxml=report.xml; popd"
if (( $? != 0 ))
then
echo "Unable to run smoketest"
exit 1
fi
echo "Smoke test complete"

View file

@ -0,0 +1,7 @@
# content of test_smoke.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5

View file

@ -62,5 +62,11 @@ sudo mount /dev/nvme1n1 /data
sudo chown -R ec2-user /data
echo "Installing pytest"
pip3 install -U pytest
pip3 install -U requests
echo "Done."