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 cleanup #2

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Conversation

theneva
Copy link

@theneva theneva commented Jun 13, 2024

I cleaned up the tests according to @thomas11's review

@theneva theneva changed the base branch from master to fix/env-remote-pr June 13, 2024 09:59
@thomas11
Copy link

A little unfortunate that your commit is based on master, that conflates a bunch of changes with your actual test change. Any chance you could rebase on @julsemaan's PR branch?

Comment on lines +13 to +16
type TestSshServer struct {
Host string
Port int64
}
Copy link
Author

@theneva theneva Jun 13, 2024

Choose a reason for hiding this comment

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

I put this file in the testutil directory so it can be reused in the other test that depends on an SSH server.

I made that change here: theneva@bbae30e, and I'd love to include it as part of this PR. However, the test fails for me locally even on master, and I don't want to touch it (or block this PR on that unrelated change) since I can't verify the fix.

I'm happy to send that commit as a separate PR to pulumi/pulumi-command after this PR lands.

Choose a reason for hiding this comment

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

That's a great move. I can help getting the other test to pass. It should pass on master in any case. What's the error you're getting?

Copy link
Author

Choose a reason for hiding this comment

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

Just to be clear: The new test I wrote passes on my machine just fine. I hope we can land this PR without figuring out why the TestOptionalLogging test fails for me!

Buuuut since you asked:

I get assertions failures that seem to indicate that the output from the SSH server just doesn't get registered by the context.

I made a quick recording, showing me running go test ./... from ./provider on the latest origin/master (9144544):

command-test-error-on-master.mov

I'm running this Go (installed with homebrew):

$ go version
go version go1.22.3 darwin/arm64

… on this machine:

image

I also tried running go install ./... and go mod tidy just to be sure, but neither command did anything.

Again, I'm happy to help with figuring out why that test fails for me, but I'd really like to land this PR first 😅

Choose a reason for hiding this comment

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

I can reproduce this and will look into it.

Choose a reason for hiding this comment

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

The regression was introduced by 36798ab Upgrade to latest pulumi-go-provider v0.17 (#442).

The reason CI tests pass is that it runs go test in provider/tests, not /provider - needs to be fixed as well.

Copy link
Author

Choose a reason for hiding this comment

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

I see! That sounds like a fix for master. I'm happy to submit the change to use the new common test SSH server once it works on master

Choose a reason for hiding this comment

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

This is now fixed in master.

Copy link
Author

Choose a reason for hiding this comment

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

Awesome! By the way, are you able to merge this PR? If you can, I'm pretty sure Julien won't mind 😄

@theneva
Copy link
Author

theneva commented Jun 13, 2024

A little unfortunate that your commit is based on master, that conflates a bunch of changes with your actual test change. Any chance you could rebase on @julsemaan's PR branch?

sorry @thomas11, I did change my mind and change it to be like you ask, but it looks like you're just too fast for me 😅 care to take another look now that the diff is smaller, please?

@@ -331,11 +313,12 @@ func TestRemoteCommandStdoutStderrFlag(t *testing.T) {
})

t.Run("update-actual-without-std", func(t *testing.T) {
t.Parallel()

Choose a reason for hiding this comment

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

Both of these tests update the same resource, right? Can they really run in any order then?

Copy link
Author

Choose a reason for hiding this comment

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

Huh, I apparently only read half of your comment, and just made them run in parallel…

I didn't have any issues with the parallelism when running the tests locally, but I suppose you're right that they might get in each other's way.

Addressing your original comment on this: The create step does have an assertion that's relevant to the test, so I don't really view it as pure setup. Keeping it as part of the test – the way it is right now – makes the most sense to me.

Do you think this part looks ready to merge now?

Choose a reason for hiding this comment

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

Yep, LGTM!

Comment on lines +13 to +16
type TestSshServer struct {
Host string
Port int64
}

Choose a reason for hiding this comment

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

That's a great move. I can help getting the other test to pass. It should pass on master in any case. What's the error you're getting?

@theneva
Copy link
Author

theneva commented Jun 17, 2024

@julsemaan looks like we're good to go! If you agree, will you merge this PR? 😄

@julsemaan
Copy link
Owner

@julsemaan looks like we're good to go! If you agree, will you merge this PR? 😄

image

@julsemaan julsemaan merged commit e37c236 into julsemaan:fix/env-remote-pr Jun 17, 2024
@theneva theneva deleted the test-cleanup branch June 17, 2024 12:17
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.

3 participants