diff --git a/.github/workflows/scheduled-tests.yml b/.github/workflows/scheduled-tests.yml index 90936250c..38246c4e6 100644 --- a/.github/workflows/scheduled-tests.yml +++ b/.github/workflows/scheduled-tests.yml @@ -29,4 +29,4 @@ jobs: - name: Test with pytest run: | - pytest -s tests/scheduled_tests.py + pytest -s tests/scheduled_checks.py diff --git a/tests/scheduled_checks.py b/tests/scheduled_checks.py index 2e2927889..92cad769f 100644 --- a/tests/scheduled_checks.py +++ b/tests/scheduled_checks.py @@ -2,6 +2,7 @@ import pytest import sys import requests +from tqdm import tqdm from astrodbkit2.astrodb import create_database, Database from scripts.ingests.utils import check_internet_connection @@ -53,7 +54,7 @@ def test_spectra_urls(db): codes = [] internet = check_internet_connection() if internet: - for spectrum_url in spectra_urls["spectrum"]: + for spectrum_url in tqdm(spectra_urls["spectrum"]): request_response = requests.head(spectrum_url) status_code = request_response.status_code # The website is up if the status code is 200 @@ -61,6 +62,5 @@ def test_spectra_urls(db): if status_code != 200 and status_code != 301: broken_urls.append(spectrum_url) codes.append(status_code) - assert ( - len(broken_urls) == 149 + assert (149 <= len(broken_urls) <= 150 ), f"found {len(broken_urls)} broken spectra urls: {broken_urls}, {codes}"