Skip to content

Commit

Permalink
#296: allow to skip neptune upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Aug 7, 2024
1 parent 7fffdb7 commit 03fc914
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
shell: bash -el {0}
run: |
cd tests
. ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME ${GITHUB_SHA::7} $BRANCH_NAME
. ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME True ${GITHUB_SHA::7} $BRANCH_NAME
- name: Cleanup
if: always()
shell: bash -el {0}
Expand Down
11 changes: 9 additions & 2 deletions tests/e2e_tests/calc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def _get_history_plots(test_results: dict, metrics_classes: list):
if __name__ == "__main__":
test_case_name = sys.argv[1]
run_time_minutes = int(sys.argv[2]) / 60
short_sha = sys.argv[3]
branch_name = sys.argv[4]
neptune_upload = sys.argv[3] == "True"
short_sha = sys.argv[4]
branch_name = sys.argv[5]

test_case = get_test_case(test_case_name)
selected_metrics = test_case["metrics"] # ['BasicStats', ]
Expand Down Expand Up @@ -213,6 +214,12 @@ def _get_history_plots(test_results: dict, metrics_classes: list):
except Exception as e:
print(e)
finally:
print(test_results)

if not neptune_upload:
print("skipping neptune upload")
exit(0)

neptune_run = neptune.init_run(
project=NEPTUNE_PROJECT_NAME,
tags=[test_case_name, short_sha, branch_name],
Expand Down
7 changes: 4 additions & 3 deletions tests/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
set -e -u
TEST_CASE_NAME=$1
ENV_NAME=$2
SHORT_SHA=${3:-sha_na}
BRANCH_NAME=${4:-branch_na}
NEPTUNE_UPLOAD=${3:-False}
SHORT_SHA=${4:-sha_na}
BRANCH_NAME=${5:-branch_na}

cd e2e_tests

Expand All @@ -18,6 +19,6 @@ ls */*

RUN_TIME=$(($(date +%s) - $TIMESTAMP_START))

conda run -n $ENV_NAME --no-capture-output python calc_metrics.py $TEST_CASE_NAME $RUN_TIME $SHORT_SHA $BRANCH_NAME
conda run -n $ENV_NAME --no-capture-output python calc_metrics.py $TEST_CASE_NAME $RUN_TIME $NEPTUNE_UPLOAD $SHORT_SHA $BRANCH_NAME

cd -

0 comments on commit 03fc914

Please sign in to comment.