Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aicsimageio test #77

Merged
merged 12 commits into from
Feb 3, 2021
Merged

Add aicsimageio test #77

merged 12 commits into from
Feb 3, 2021

Conversation

tlambert03
Copy link
Owner

since aicsimageio is probably one of the main users of this library, it'd be nice to know if I'm breaking anything as I iterate. This adds a github action that runs some of the aicsimageio/main branch tests whenever merging to master.

@JacksonMaxfield and @toloudis, would be good to get your input on this. At the moment, I'm only running pytest aicsimageio/tests/readers/test_ome_tiff_reader.py -v -k "not REMOTE" ... but if you can point me to other tests that might directly or indirectly use ome-types functionality i can add them

@tlambert03
Copy link
Owner Author

Copy link
Contributor

@evamaxfield evamaxfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. I learned some stuff here and it's great to see integration tests between the two libs like this.

I may make a PR back to this library once we have the OmeTiffWriter back in the main to include it's tests here as I expect there will be more specific ome-types API usage in that function than in the reader.

Comment on lines +6 to +13
def download_test_resources() -> None:
root = Path(__file__).parent.parent.parent
resources = (root / "aicsimageio" / "aicsimageio" / "tests" / "resources").resolve()
resources.mkdir(exist_ok=True)
package = Package.browse(
"aicsimageio/test_resources", "s3://aics-modeling-packages-test-resources"
)
package["resources"].fetch(resources)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you saw that we have a weird test resources setup!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it actually. nice way to access lots of extra-repo data!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if I should place the test resources hash in a text file that you can then read and use here because the latest test resources may not match up with the specific ones for the main branch. Versioned s3 buckets and all.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I wasn't sure about that part... you can see I just removed the hash here, assuming it would go out of date at some point. if you can think of a good trick for me to use that'd be great

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I will get a patch out for it tonight.

Comment on lines +29 to +33
- uses: actions/cache@v2
id: cache
with:
path: aicsimageio/aicsimageio/tests/resources
key: ${{ runner.os }}-${{ hashFiles('.github/scripts/download_aics_test_data.py') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah. TIL about this one. This will have to be added to our workflows!

@evamaxfield
Copy link
Contributor

Also I didn't even know about the -k "not REMOTE" for pytest.

@tlambert03
Copy link
Owner Author

my favorite flag! the -k EXPRESSION option is super powerful for selecting a subset of tests

Copy link

@toloudis toloudis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, this feels a bit weird to me in the sense that it's not this project's responsibility to test aicsimageio. Future changes to aicsimageio's tests could then break ome-types's tests. But I suppose I have nothing against it if you want to adopt that risk, and this seems like a nice quick way to get there.

@tlambert03
Copy link
Owner Author

tlambert03 commented Feb 3, 2021

hah. ok!
I don't see it as my responsibility and I'm certainly not promising to run your stuff forever. There's no risk to me at all. I'm only running after merging to master as a "heads up" to check if I've broken an API that others may be using ... (i.e. it's never going to fail my own PRs). If your tests start breaking for reasons unrelated to ome-types, I'll just stop testing it.

Future changes to aicsimageio's tests could then break ome-types's tests.

(just want to point out here, I'm not directly using aicsimagio in any of my tests ... I'm literally just cloning your repo and running a subset of your own tests)

@tlambert03 tlambert03 merged commit cd15bca into master Feb 3, 2021
@tlambert03 tlambert03 deleted the test-aics branch February 3, 2021 20:31
@toloudis
Copy link

toloudis commented Feb 3, 2021

hah. ok!
I don't see it as my responsibility and I'm certainly not promising to run your stuff forever. There's no risk to me at all. I'm only running after merging to master as a "heads up" to check if I've broken an API that others may be using ... (i.e. it's never going to fail my own PRs). If your tests start breaking for reasons unrelated to ome-types, I'll just stop testing it.

Future changes to aicsimageio's tests could then break ome-types's tests.

(just want to point out here, I'm not directly using aicsimagio in any of my tests ... I'm literally just cloning your repo and running a subset of your own tests)

My mistake on that :). All looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants