diff --git a/.gitignore b/.gitignore index d7356ece0..15cd5096c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ pilosa launch.json .terraform.lock.hcl __pycache__/ +report.xml diff --git a/qa/scripts/setupSmokeTest.sh b/qa/scripts/setupSmokeTest.sh index 09e178668..0244ae7ae 100755 --- a/qa/scripts/setupSmokeTest.sh +++ b/qa/scripts/setupSmokeTest.sh @@ -29,7 +29,7 @@ do break echo "Cluster is up after $${i} tries." fi - sleep 20 + sleep 10 done diff --git a/qa/scripts/testSmokeTest.sh b/qa/scripts/testSmokeTest.sh index 2d6b5892b..089fd6ea2 100755 --- a/qa/scripts/testSmokeTest.sh +++ b/qa/scripts/testSmokeTest.sh @@ -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" \ No newline at end of file diff --git a/qa/testcases/smoketest/test_smoke.py b/qa/testcases/smoketest/test_smoke.py new file mode 100644 index 000000000..ba45124ff --- /dev/null +++ b/qa/testcases/smoketest/test_smoke.py @@ -0,0 +1,7 @@ +# content of test_smoke.py +def inc(x): + return x + 1 + + +def test_answer(): + assert inc(3) == 5 \ No newline at end of file diff --git a/qa/tf/.modules/featurebase-cluster/setup_ingest_node.sh.tpl b/qa/tf/.modules/featurebase-cluster/setup_ingest_node.sh.tpl index 1e93149b1..51c98d65f 100644 --- a/qa/tf/.modules/featurebase-cluster/setup_ingest_node.sh.tpl +++ b/qa/tf/.modules/featurebase-cluster/setup_ingest_node.sh.tpl @@ -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." +