diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml deleted file mode 100644 index ba1eaf78..00000000 --- a/.github/workflows/e2e-tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Run end-to-end tests - -on: - pull_request: - push: - workflow_dispatch: -# schedule: -# # Run every Sunday at 04:53 UTC -# - cron: 53 4 * * 0 - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - name: Install package inside virtual environment - run: | - python3.8 -m venv venv - source venv/bin/activate - python -m pip install -U pip setuptools - python -m pip install . - - - name: Run pipeline for SNPCC - run: | - source venv/bin/activate - ./tests/run-snpcc-e2e.sh diff --git a/tests/run-snpcc-e2e.sh b/tests/run-snpcc-e2e.sh deleted file mode 100755 index 6e82087d..00000000 --- a/tests/run-snpcc-e2e.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e - -# Create a temporary directory for the test -TEST_DIR=$(mktemp -d) -echo "Created test directory: $TEST_DIR" - -# Unpack the SNPCC dataset -FULL_DATASET=${TEST_DIR}/snpcc_full -mkdir -p ${FULL_DATASET} -tar -xzf data/SIMGEN_PUBLIC_DES.tar.gz -C ${FULL_DATASET} - -# Copy few objects -INPUT_DATASET=${TEST_DIR}/snpcc -mkdir -p ${INPUT_DATASET} -cp ${FULL_DATASET}/SIMGEN_PUBLIC_DES/DES_SN00*.DAT ${INPUT_DATASET}/ - -# Extract features from the SNPCC dataset -FEATURES=${TEST_DIR}/features.dat -fit_dataset -s SNPCC -dd ${INPUT_DATASET} -o ${FEATURES} - -# Run training loop -METRICS=${TEST_DIR}/metrics.csv -QUERIES=${TEST_DIR}/queries.csv -run_loop -i ${FEATURES} -b 1 -n 5 -m ${METRICS} -q ${QUERIES} -s UncSampling -t 10 -mt bazin - -echo "### ${METRICS}:" -cat ${METRICS} diff --git a/tests/test_learn_loop.py b/tests/test_learn_loop.py index 110a4fde..f5c6752f 100644 --- a/tests/test_learn_loop.py +++ b/tests/test_learn_loop.py @@ -24,5 +24,30 @@ def test_can_run_learn_loop(test_des_data_path): output_queried_file=os.path.join(dir_name,"just_other_name.csv"), ) + +def test_can_run_learn_loop_uncsample(test_des_data_path): + """Test that learn_loop can load data and run. + This instance is distinct from the previous because it uses `UncSample` strategy + and runs for 5 loops instead of 1. + """ + with tempfile.TemporaryDirectory() as dir_name: + # Create the feature files to use for the learning loop. + output_file = os.path.join(dir_name, "output_file.dat") + fit_snpcc( + path_to_data_dir=test_des_data_path, + features_file=output_file + ) + + learn_loop( + nloops=5, + features_method="bazin", + strategy="UncSampling", + path_to_features=output_file, + output_metrics_file=os.path.join(dir_name,"just_a_name.csv"), + output_queried_file=os.path.join(dir_name,"just_other_name.csv"), + training=10, + ) + + if __name__ == '__main__': pytest.main()