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

TST Refactor: clean persistence tests to avoid duplicate testing #202

Conversation

BenjaminBossan
Copy link
Collaborator

Resolves #198

After introducing dumps and loads, we ran all persistence tests twice, once with those functions and once with dump and load. This is inefficient, since they're basically testing the same thing but running 400+ tests twice is costly. With this PR, we only use the more efficient dumps and loads. On top of that, there is one test that very specifically tests dump and load.

@BenjaminBossan
Copy link
Collaborator Author

@skops-dev/maintainers ready for review

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Thanks, otherwise LGTM.

return self


def test_dump_to_and_load_from_disk(tmp_path):
Copy link
Member

Choose a reason for hiding this comment

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

maybe as an alternative, or another test, we could save/load from disk and memory, and compare the objects' hashes to make sure they're the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I can add another test. To be sure I understand correctly, you mean comparing the hashes of both objects in memory, one obtained through dump/load and one for dumps/loads? If so, what method would you use to hash them, joblib.hash?

Copy link
Member

Choose a reason for hiding this comment

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

yes, exactly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@adrinjalali adrinjalali changed the title Refactor: clean persistence tests to avoid duplicate testing TST Refactor: clean persistence tests to avoid duplicate testing Oct 25, 2022
@adrinjalali adrinjalali merged commit 6b62132 into skops-dev:main Oct 25, 2022
@BenjaminBossan BenjaminBossan deleted the refactor-clean-persistence-tests-no-dups branch October 25, 2022 15:12
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.

Clean up persistence tests to make them run faster
2 participants