Skip to content

Commit

Permalink
Revert "[Cherry Pick] Enable canary report generation (awslabs#634)"
Browse files Browse the repository at this point in the history
This reverts commit 632ec70.
  • Loading branch information
jsitu777 committed Apr 12, 2023
1 parent 70dab26 commit f03d691
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
14 changes: 4 additions & 10 deletions tests/canary/canary.buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ phases:
# Get cached test image
- aws ecr get-login-password --region $CLUSTER_REGION | docker login --username AWS --password-stdin $ECR_CACHE_URI || true
- docker pull ${ECR_CACHE_URI}:latest --quiet || true

# Build test image
- >
docker build -f ./tests/canary/Dockerfile.canary . -t ${ECR_CACHE_URI}:latest --quiet
Expand All @@ -14,15 +15,8 @@ phases:
commands:
# Run tests
- docker run --name kf-distro-canary $(env | cut -f1 -d= | sed 's/^/-e /') --mount type=bind,source="$(pwd)/",target="/kubeflow-manifests/" ${ECR_CACHE_URI}:latest
post_build:
commands:
- docker cp kf-distro-canary:/kubeflow-manifests/tests/canary/integration_tests.xml /tmp/results.xml || true
# Push test image to cache ECR repo

# Push test image to cache ECR repo
- docker push ${ECR_CACHE_URI}:latest || true

reports:
IntegrationTestReport:
files:
- "results.xml"
base-directory: "/tmp"


9 changes: 1 addition & 8 deletions tests/canary/scripts/push_stats_to_cloudwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@ def readXML_and_publish_metrics_to_cw():
failures = testsuite.attrib["failures"]
tests = testsuite.attrib["tests"]
successes = int(tests) - int(failures)
<<<<<<< HEAD
success_rate = successes/int(tests)*100
else:
failures = 0
successes = 0
tests = 0
success_rate = 0
=======
else:
failures = 0
successes = 0
tests = 1
>>>>>>> 632ec70b ([Cherry Pick] Enable canary report generation (#634))

timestamp = datetime.now().strftime("%Y-%m-%dT%H:%M:%S")

Expand Down Expand Up @@ -105,4 +98,4 @@ def main():


if __name__ == "__main__":
main()
main()
10 changes: 5 additions & 5 deletions tests/canary/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
# Script configuration
set -euo pipefail

function push_to_cloudwatch {
echo "Pushing Codebuild stats to Cloudwatch."
python ../canary/scripts/push_stats_to_cloudwatch.py
function onError {
echo "Run test FAILED. Exiting."
}
trap push_to_cloudwatch EXIT
trap onError ERR

export CANARY_TEST_DIR=${REPO_PATH}/tests/canary
export E2E_TEST_DIR=${REPO_PATH}/tests/e2e
Expand All @@ -32,5 +31,6 @@ mkdir -p $E2E_TEST_DIR/.metadata/
cp metadata-canary $E2E_TEST_DIR/.metadata/

cd $E2E_TEST_DIR
pytest tests/test_sanity_portforward.py -s -q --metadata .metadata/metadata-canary --region $CLUSTER_REGION --installation_option $INSTALLATION_OPTION --junitxml ../canary/integration_tests.xml
pytest tests/test_sanity_portforward.py -s -q --metadata .metadata/metadata-canary --region $CLUSTER_REGION --installation_option $INSTALLATION_OPTION


0 comments on commit f03d691

Please sign in to comment.