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

Make testpachd a runnable binary #9887

Merged
merged 15 commits into from Mar 29, 2024
Merged

Make testpachd a runnable binary #9887

merged 15 commits into from Mar 29, 2024

Conversation

jrockway
Copy link
Member

@jrockway jrockway commented Mar 26, 2024

This makes testpachd runnable with bazel run //src/testing/testpachd.

It will automatically setup a pachctl context when the server is ready, and restore to whatever you had before when exiting.

Right now you can't activate auth, but in #9886 I made testpachd auth-ready, so when that is merged I will add an "activateAuth" flag to start it up with auth.

This should eliminate most of integrations' need to use k8s in their tests, which will make their tests much faster. It's also handy for local debugging, of course.

@pachyderm/pfs review is required because I refactored a utility function to not need a *testing.T, and updated a caller in src/server/pfs/testing.

Unrelated change: while I was in here, I made the grpc validation interceptor not log a warning during health checks.

@jrockway jrockway requested a review from a team as a code owner March 26, 2024 02:48
@jrockway jrockway force-pushed the jonathan/runnable-testpachd branch from f81933b to 1598552 Compare March 26, 2024 20:33
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 48.17518% with 213 lines in your changes are missing coverage. Please review.

Project coverage is 57.96%. Comparing base (89ed648) to head (d9182f0).

Files Patch % Lines
src/internal/pachd/testpachd.go 38.31% 95 Missing ⚠️
src/internal/dockertestenv/postgres.go 1.92% 51 Missing ⚠️
src/internal/dockertestenv/minio.go 0.00% 43 Missing ⚠️
src/internal/pachd/full.go 86.86% 13 Missing ⚠️
src/server/metadata/server/api_server.go 60.00% 4 Missing ⚠️
src/internal/testutil/db.go 82.35% 3 Missing ⚠️
src/internal/cleanup/cleanup.go 92.30% 2 Missing ⚠️
src/internal/pachd/setup.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9887       +/-   ##
===========================================
+ Coverage   41.64%   57.96%   +16.32%     
===========================================
  Files         548      607       +59     
  Lines       65290    73907     +8617     
===========================================
+ Hits        27188    42840    +15652     
+ Misses      36046    30511     -5535     
+ Partials     2056      556     -1500     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@robert-uhl robert-uhl left a comment

Choose a reason for hiding this comment

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

I believe that this can be rewritten to not need the cleanup package at all, or perhaps use it internally, by e.g. running in one function and deferring release of resources until the end, or by allocating resources, returning and deferring a close/release in the caller.

src/internal/testutil/db.go Show resolved Hide resolved
src/testing/testpachd/main.go Outdated Show resolved Hide resolved
src/testing/testpachd/main.go Show resolved Hide resolved
@jrockway jrockway force-pushed the jonathan/runnable-testpachd branch from 65504d0 to d8caafe Compare March 28, 2024 22:40
@jrockway jrockway force-pushed the jonathan/runnable-testpachd branch from d8caafe to 0b07006 Compare March 29, 2024 00:40
@jrockway
Copy link
Member Author

Please take another look. @Zhang-Muyang you have to approve if you're OK with the changes from PFS's perspective, a comment saying "looks good" won't do it.

@Zhang-Muyang Zhang-Muyang self-requested a review March 29, 2024 14:22
@jrockway jrockway merged commit 62c27c3 into master Mar 29, 2024
21 checks passed
@jrockway jrockway deleted the jonathan/runnable-testpachd branch March 29, 2024 16:31
zmajeed pushed a commit that referenced this pull request Apr 2, 2024
This makes testpachd runnable with `bazel run //src/testing/testpachd`.

It will automatically setup a pachctl context when the server is ready,
and restore to whatever you had before when exiting.

This should eliminate most of integrations' need to use k8s in their
tests, which will make their tests much faster. It's also handy for
local debugging, of course.

Unrelated change: while I was in here, I made the grpc validation
interceptor not log a warning during health checks.
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.

None yet

3 participants