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

test: xrootd server fixture #1076

Merged
merged 4 commits into from
Dec 21, 2023
Merged

test: xrootd server fixture #1076

merged 4 commits into from
Dec 21, 2023

Conversation

lobis
Copy link
Collaborator

@lobis lobis commented Dec 20, 2023

Add a pytest fixture for xrootd server which can be used to serve files locally over xrootd. We might want to switch to use this for all xrootd tests to avoid networking / server issues.

I updated one xrootd test to use this new fixture.

I also renamed the old "server" fixture to "http_server" since now we have more than one server fixture.

@lobis lobis requested a review from jpivarski December 20, 2023 17:47
@lobis lobis marked this pull request as ready for review December 20, 2023 17:47
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Cool! I looked through the implementation of the local XRootD server. I'm not sure why it's an iterator with exactly one yield: I don't think that allows it to run asynchronously.

@lobis
Copy link
Collaborator Author

lobis commented Dec 21, 2023

Cool! I looked through the implementation of the local XRootD server. I'm not sure why it's an iterator with exactly one yield: I don't think that allows it to run asynchronously.

I've writen a couple of fixtures and they all follow the same pattern (this one is actually based on what's used in fsspec-xrootd). My understanding is that fixtures have this structure so that setup / cleanup can be defined in a single function. First the fixture method is run until the yield (setup), then the test code is ran, then the code after the yield (cleanup) is ran.

@lobis lobis merged commit 2661616 into main Dec 21, 2023
21 checks passed
@lobis lobis deleted the pytest-xrootd-fixture branch December 21, 2023 14:51
lobis added a commit that referenced this pull request Jan 22, 2024
* origin/main: (41 commits)
  chore: hatch-vcs generates 'version.py'; add it to .gitignore
  docs: add bnavigator as a contributor for test (#1087)
  feat: support for writing hist derived profiles (#1000)
  feat: add the ability to read RNTuple alias columns (#1004)
  chore: update pre-commit hooks (#1082)
  docs: fix ReadTheDocs documentation (#1084)
  chore: update pre-commit hooks (#1073)
  chore(deps): bump actions/upload-artifact from 3 to 4 (#1071)
  chore(deps): bump actions/download-artifact from 3 to 4 (#1072)
  build: change build to autogen version info (#1062)
  chore: remove src/uproot/version.py (for #1062).
  The next release will be 5.2.1.
  add known_base_form option so that opening root files can be avoided for mature analyses (#1077)
  test: fsspec cache (#1075)
  test: xrootd server fixture (#1076)
  The next release will be 5.2.0.
  fix: correct typo in fsspec globbing (#1067)
  chore(deps): bump actions/setup-python from 4 to 5 (#1059)
  The next release will be 5.2.0rc5.
  fix: dask distributed fsspec issue (#1065)
  ...
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