Skip to content

Commit

Permalink
fix ci: run only tests that does not involve any fits files, add fixm…
Browse files Browse the repository at this point in the history
…e comment for fitsrs being too slow, git rm fits samples files from the repo
  • Loading branch information
bmatthieu3 committed Jan 29, 2025
1 parent f3fa7c2 commit dc26ed1
Show file tree
Hide file tree
Showing 32 changed files with 18 additions and 113,332 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Build
run: cargo build --verbose
# only run tests that does not involve fits files because they are not located in the repo anymore
# the (--lib) argument only execute tests from the library and not the doctest (which open a file not in the repo)
- name: Run tests
run: cargo test --verbose
run: cargo test --lib --verbose -- --skip "test_fits"
188 changes: 0 additions & 188 deletions samples/fits.gsfc.nasa.gov/Astro_UIT.fits

This file was deleted.

1,796 changes: 0 additions & 1,796 deletions samples/fits.gsfc.nasa.gov/EUVE.fits

This file was deleted.

91,976 changes: 0 additions & 91,976 deletions samples/fits.gsfc.nasa.gov/HST_FGS.fits

This file was deleted.

12,802 changes: 0 additions & 12,802 deletions samples/fits.gsfc.nasa.gov/HST_FOC.fits

This file was deleted.

42 changes: 0 additions & 42 deletions samples/fits.gsfc.nasa.gov/HST_FOS.fits

This file was deleted.

101 changes: 0 additions & 101 deletions samples/fits.gsfc.nasa.gov/HST_HRS.fits

This file was deleted.

1,582 changes: 0 additions & 1,582 deletions samples/fits.gsfc.nasa.gov/HST_NICMOS.fits

This file was deleted.

1,814 changes: 0 additions & 1,814 deletions samples/fits.gsfc.nasa.gov/HST_WFPC_II.fits

This file was deleted.

135 changes: 0 additions & 135 deletions samples/fits.gsfc.nasa.gov/HST_WFPC_II_bis.fits

This file was deleted.

26 changes: 0 additions & 26 deletions samples/fits.gsfc.nasa.gov/IUE_LWP.fits

This file was deleted.

660 changes: 0 additions & 660 deletions samples/fits.gsfc.nasa.gov/Random_Groups.fits

This file was deleted.

Binary file removed samples/hips2fits/.DS_Store
Binary file not shown.
Binary file removed samples/hips2fits/allsky_panstarrs.fits
Binary file not shown.
Binary file removed samples/hips2fits/cutout-CDS_P_HST_PHAT_F475W.fits
Binary file not shown.
Binary file removed samples/hipsgen/.DS_Store
Binary file not shown.
Binary file removed samples/hipsgen/Npix132.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix133.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix134.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix140.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix208.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix282.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix4906.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix691539.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix8.fits
Binary file not shown.
Binary file removed samples/hipsgen/Npix9.fits
Binary file not shown.
688 changes: 0 additions & 688 deletions samples/misc/bonn.fits

This file was deleted.

1,503 changes: 0 additions & 1,503 deletions samples/misc/skv1678175163788.fits

This file was deleted.

2 changes: 1 addition & 1 deletion src/hdu/header/extension/asciitable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ mod tests {
// These tests have been manually created thanks to this command on the fits files:
// strings samples/fits.gsfc.nasa.gov/HST_HRS.fits | fold -80 | grep "TBCOL" | tr -s ' ' | cut -d ' ' -f 3
#[test]
fn test_asciitable_extension() {
fn test_fits_asciitable_extension() {
compare_ascii_ext(
"samples/fits.gsfc.nasa.gov/HST_FGS.fits",
AsciiTable {
Expand Down
2 changes: 1 addition & 1 deletion src/hdu/header/extension/bintable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ mod tests {
// These tests have been manually created thanks to this command on the fits files:
// strings samples/fits.gsfc.nasa.gov/HST_HRS.fits | fold -80 | grep "TBCOL" | tr -s ' ' | cut -d ' ' -f 3
#[test]
fn test_bintable_extension() {
fn test_fits_bintable_extension() {
compare_bintable_ext(
"samples/fits.gsfc.nasa.gov/IUE_LWP.fits",
BinTable {
Expand Down
15 changes: 7 additions & 8 deletions src/hdu/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,10 @@ mod tests {
}

#[test]
fn test_keywords_iter() {
fn test_fits_keywords_iter() {
let f = File::open("samples/misc/SN2923fxjA.fits").unwrap();
let bytes: Result<Vec<_>, _> = f.bytes().collect();
let buf = bytes.unwrap();

let reader = Cursor::new(&buf[..]);
let reader = std::io::BufReader::new(f);
let mut hdu_list = Fits::from_reader(reader);

let hdu = hdu_list.next().unwrap().unwrap();
Expand All @@ -541,13 +539,14 @@ mod tests {
let mut actuals = hdu.get_header().keywords().collect::<Vec<_>>();
actuals.sort_unstable();

/* COMMENT and HISTORY are not part of the cards having values which is what returns keywords */
let mut expected = VecDeque::from(vec![
"BAYERIND", "BITCAMPX", "CALPHOT", "CCD-TEMP", "CD1_1", "CD1_2", "CD2_1",
"CD2_2", "CDELT1", "CDELT2", "CDELTM1", "CDELTM2", /* "COMMENT",*/ "COMPRESS",
"BAYERIND", "BITCAMPX", "BITPIX", "CALPHOT", "CCD-TEMP", "CD1_1", "CD1_2", "CD2_1",
"CD2_2", "CDELT1", "CDELT2", "CDELTM1", "CDELTM2"/*, "COMMENT" */, "COMPRESS",
"CRPIX1", "CRPIX2", "CRVAL1", "CRVAL2", "CTYPE1", "CTYPE2", "CUNIT1",
"CUNIT2", "CVF", "DATAMAX", "DATAMIN", "DATE", "DATE-OBS", "DEC",
"DEWPOINT", "DIAMETER", "ERRFLUX", "EXPOSURE", "FILTERS", "FOCAL",
"FOCUSPOS", "FOCUSTMP", "GAIN_ELE", /* "HISTORY",*/ "HUMIDITY", "IMGTYPE",
"FOCUSPOS", "FOCUSTMP", "GAIN_ELE", /*"HISTORY", */ "HUMIDITY", "IMGTYPE",
"INSTRUME", "MAGREF", "MIRORX", "NAXIS", "NAXIS1", "NAXIS2", "OBJCTDEC",
"OBJCTRA", "OBSERVER", "OFFSET_E", "ORIGIN", "P3DSPHER", "PCXASTRO",
"PCYASTRO", "PDEC_REF", "PDIMPOL", "PIERSIDE", "PPLATESD", "PPXC", "PPYC",
Expand All @@ -574,7 +573,7 @@ mod tests {
"PSOLY22", "PSOLY23", "PSOLY24", "PSOLY25", "PSOLY26", "PSOLY27",
"PSOLY28", "PSOLY29", "PSOLY3", "PSOLY30", "PSOLY31", "PSOLY32", "PSOLY33",
"PSOLY34", "PSOLY35", "PSOLY36", "PSOLY4", "PSOLY5", "PSOLY6", "PSOLY7",
"PSOLY8", "PSOLY9", "PSSX", "PSSY", "RA", "READOUTT", "REFFLUX", "SITELAT",
"PSOLY8", "PSOLY9", "PSSX", "PSSY", "RA", "READOUTT", "REFFLUX", "SIMPLE", "SITELAT",
"SITELONG", "STACKNB", "STARCNT", "SWCREATE", "TELESCOP", "TEMPEXT", "UT",
"WINDIR", "WINSPEED", "X1", "X2", "XPIXELSZ", "XPIXSZ", "Y1", "Y2",
"YPIXELSZ", "YPIXSZ"
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mod tests {
#[test_case("samples/fits.gsfc.nasa.gov/HST_NICMOS.fits", 7, 0, 0)]
#[test_case("samples/fits.gsfc.nasa.gov/HST_WFPC_II.fits", 2, 1, 0)]
#[test_case("samples/fits.gsfc.nasa.gov/HST_WFPC_II_bis.fits", 2, 0, 0)]
fn test_count_hdu(
fn test_fits_count_hdu(
filename: &str,
num_image_ext: usize,
num_asciitable_ext: usize,
Expand Down Expand Up @@ -210,8 +210,9 @@ mod tests {
#[test_case("samples/vizier/VAR.358.R.fits", false)]
#[test_case("samples/fits.gsfc.nasa.gov/IUE_LWP.fits", false)]
#[test_case("samples/misc/bonn.fits", false)]
#[test_case("samples/misc/EUC_MER_MOSAIC-VIS-FLAG_TILE100158585-1EC1C5_20221211T132329.822037Z_00.00.fits", false)]
#[test_case("samples/misc/P122_49.fits", false)]
// FIXME too slow, to retest when we implement the seek of the data unit part
//#[test_case("samples/misc/EUC_MER_MOSAIC-VIS-FLAG_TILE100158585-1EC1C5_20221211T132329.822037Z_00.00.fits", false)]
//#[test_case("samples/misc/P122_49.fits", false)]
#[test_case("samples/misc/skv1678175163788.fits", false)]
#[test_case("samples/misc/SN2923fxjA.fits", false)]
fn test_fits_opening(filename: &str, corrupted: bool) {
Expand Down Expand Up @@ -447,7 +448,8 @@ mod tests {
assert!(hdu_list.next().unwrap().is_err());
}

#[test_case("samples/misc/EUC_MER_MOSAIC-VIS-FLAG_TILE100158585-1EC1C5_20221211T132329.822037Z_00.00.fits")]
// FIXME too slow, to retest when we implement the seek of the data unit part
//#[test_case("samples/misc/EUC_MER_MOSAIC-VIS-FLAG_TILE100158585-1EC1C5_20221211T132329.822037Z_00.00.fits")]
#[test_case("samples/fits.gsfc.nasa.gov/EUVE.fits")]
#[test_case("samples/fits.gsfc.nasa.gov/HST_FOC.fits")]
#[test_case("samples/vizier/new_url.fits")]
Expand Down

0 comments on commit dc26ed1

Please sign in to comment.