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: port remote pinning tests to Go #9720

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Conversation

guseggert
Copy link
Contributor

This also means that rb-pinning-service-api is no longer required for running remote pinning tests. This alone saves at least 3 minutes in test runtime in CI because we don't need to checkout the repo, build the Docker image, run it, etc.

Instead this implements a simple pinning service in Go that the test runs in-process, with a callback that can be used to control the async behavior of the pinning service (e.g. simulate work happening asynchronously like transitioning from "queued" -> "pinning" -> "pinned").

This also adds an environment variable to Kubo to control the MFS remote pin polling interval, so that we don't have to wait 30 seconds in the test for MFS changes to be repinned. This is purely for tests so I don't think we should document this.

This entire test suite runs in around 2.5 sec on my laptop, compared to the existing 3+ minutes in CI.

@guseggert guseggert marked this pull request as ready for review March 14, 2023 18:35
@guseggert guseggert requested a review from lidel March 14, 2023 18:35
@guseggert guseggert force-pushed the test/port-remote-pinning branch 4 times, most recently from 9981e3b to bf02a00 Compare March 16, 2023 14:16
@BigLep BigLep requested a review from Jorropo March 19, 2023 15:08
@BigLep
Copy link
Contributor

BigLep commented Mar 19, 2023

Set reviewer to @Jorropo so @guseggert / @Jorropo pair can bust through open reviews. @lidel please comment if you need to be a reviewer here.

@BigLep BigLep removed the request for review from lidel March 21, 2023 16:45
Copy link
Contributor

@Jorropo Jorropo left a comment

Choose a reason for hiding this comment

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

SGTM, I did not review pinning.go because as long as CI passes and I don't care what it does since in the current setup as a testutil no one will use this in production.

test/cli/harness/node.go Outdated Show resolved Hide resolved
test/cli/testutils/pinningservice/pinning.go Outdated Show resolved Hide resolved
test/cli/pinning_remote_test.go Outdated Show resolved Hide resolved
test/sharness/t0700-remotepin.sh Show resolved Hide resolved
test/cli/pinning_remote_test.go Show resolved Hide resolved
test/cli/pinning_remote_test.go Outdated Show resolved Hide resolved
test/cli/pinning_remote_test.go Show resolved Hide resolved
@guseggert guseggert force-pushed the test/port-remote-pinning branch 4 times, most recently from a8cdbe9 to 0df7595 Compare March 29, 2023 23:30
This also means that rb-pinning-service-api is no longer required for
running remote pinning tests. This alone saves at least 3 minutes in
test runtime in CI because we don't need to checkout the repo, build
the Docker image, run it, etc.

Instead this implements a simple pinning service in Go that the test
runs in-process, with a callback that can be used to control the async
behavior of the pinning service (e.g. simulate work happening
asynchronously like transitioning from "queued" -> "pinning" ->
"pinned").

This also adds an environment variable to Kubo to control the MFS
remote pin polling interval, so that we don't have to wait 30 seconds
in the test for MFS changes to be repinned. This is purely for tests
so I don't think we should document this.

This entire test suite runs in around 2.5 sec on my laptop, compared to
the existing 3+ minutes in CI.
Copy link
Contributor

@Jorropo Jorropo left a comment

Choose a reason for hiding this comment

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

❤️ faster CI 🎉

@guseggert guseggert merged commit a24cfb8 into master Mar 30, 2023
@guseggert guseggert deleted the test/port-remote-pinning branch March 30, 2023 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants