Skip to content

Commit

Permalink
Fix type scheduled-tests.yml (#411)
Browse files Browse the repository at this point in the history
* Fix name of the scheduled-tests.yml

* tqdm and number of broken spectra

* between 149 and 150

---------

Co-authored-by: David Rodriguez <[email protected]>
  • Loading branch information
kelle and dr-rodriguez authored Oct 17, 2023
1 parent 461aa0c commit 532b659
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Test with pytest
run: |
pytest -s tests/scheduled_tests.py
pytest -s tests/scheduled_checks.py
6 changes: 3 additions & 3 deletions tests/scheduled_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,14 +54,13 @@ 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
# cuny academic commons links give 301 status code
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}"

0 comments on commit 532b659

Please sign in to comment.