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

Replace vcr-py for tests #1198

Merged
merged 51 commits into from
Dec 3, 2024
Merged

Replace vcr-py for tests #1198

merged 51 commits into from
Dec 3, 2024

Conversation

markbader
Copy link
Contributor

@markbader markbader commented Sep 26, 2024

Description:

  • This PR should remove vcr-py and introduce a proxy server that replays API requests for the tests.

Todos:

Make sure to delete unnecessary points or to check all before merging:

  • Updated Changelog

Fixing tests:

  • Add annotation to local wk instance (e.g. tests/test_annotation.py::test_annotation_from_url)
  • Zarr Streaming doesn't seem to work for local wk instance(e.g. tests/test_annotation.py::test_bounding_box_roundtrip)
  • Remove date-strings from datasets generated within tests (e.g. tests/test_examples.py::test_upload_image_data)
  • Replaying responses for tests/dataset/test_dataset_add_remote_mag_and_layer.py does not work yet.

@markbader markbader self-assigned this Sep 26, 2024
@normanrz normanrz added this to the 2.x milestone Oct 9, 2024
Copy link
Member

@normanrz normanrz left a comment

Choose a reason for hiding this comment

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

Looks already pretty good. Maybe you can comment on the state of the commented-out code. I think some of that could be revived in a follow-up.

webknossos/test.sh Show resolved Hide resolved
webknossos/testdata/l4_sample_snipped/color/1/header.wkw Outdated Show resolved Hide resolved
webknossos/tests/conftest.py Show resolved Hide resolved
webknossos/tests/dataset/test_dataset.py Show resolved Hide resolved
webknossos/webknossos/dataset/dataset.py Show resolved Hide resolved
webknossos/webknossos/dataset/layer.py Show resolved Hide resolved
webknossos/webknossos/dataset/mag_view.py Show resolved Hide resolved
webknossos/tests/test_annotation.py Outdated Show resolved Hide resolved
"https://webknossos.org/links/93zLg9U9vJ3c_UWp",
"http://localhost:9000/datasets/Organization_X/l4_sample",
"http://localhost:9000/datasets/Organization_X/l4_sample/view",
# "http://localhost:9000/datasets/Organization_X/l4_sample_dev_sharing/view?token=ilDXmfQa2G8e719vb1U9YQ#%7B%22orthogonal%7D",
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to also test sharing links and short links. Can be a followup.

@markbader markbader marked this pull request as ready for review November 28, 2024 17:02
@markbader markbader requested a review from normanrz November 28, 2024 17:04
Copy link
Member

@normanrz normanrz left a comment

Choose a reason for hiding this comment

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

Great. Let's get this merged.

@markbader markbader merged commit 1eee692 into master Dec 3, 2024
34 checks passed
@markbader markbader deleted the introduce-proxay-for-tests branch December 3, 2024 08:27
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.

2 participants