Skip to content

Conversation

dsabeti
Copy link
Contributor

@dsabeti dsabeti commented Jan 26, 2023

Windows tests were failing for a few reasons:

  • TAR_URL needed to be specified, but the historical location for a Windows tar.exe was deleted. The good news is that we can use local tar.exe available on most Windows VMs (example, the Diego team's CI's concourse worker)
    • If TAR_URL is specified, the tests will still download and use the executable there. This could be useful if it becomes important to test with a specific version of tar.exe.
  • Some tests on windows failed when being run with a bare executable name (hello vs hello.exe). Our changes preserve the native executable as determined by go build. This got the tests to pass.

Bonus content:

  • One error message was very confusing, so we added a little language to clarify the failure
  • Added an additional assertion in a test

@aramprice

var builderArgs []string
var discoveredTarPath string
if runtime.GOOS == "windows" {
builderArgs = []string{"-tags=windows2012R2"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we're using 2012R2 instead of something more recent?

Copy link
Member

Choose a reason for hiding this comment

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

This comes from the file we deleted as part of this change:

builder, err := gexec.Build("code.cloudfoundry.org/buildpackapplifecycle/builder", "-tags=windows2012R2")

Copy link
Member

@MarcPaquette MarcPaquette left a comment

Choose a reason for hiding this comment

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

These changes look good to me. Thanks for the PR!

aramprice and others added 3 commits January 27, 2023 18:33
These tests were written when Windows did not include a tar.exe, so it had to be downloaded for Windows tests.
Newer versions of Windows include tar.exe, so we've updated the tests to fall back to trying a local tar.exe

Signed-off-by: David Sabeti <[email protected]>
These tests were failing on Windows when the test executable was explicitly
installed as 'hello', as opposed to using the native go build output of 'hello.exe'.

Changing all invocations to use the 'basename' of the go built executable (in the case of
windows an '.exe' extension is added) allowed the failing tests to succeed.

Signed-off-by: David Sabeti <[email protected]>
Signed-off-by: Aram Price <[email protected]>
@geofffranks geofffranks merged commit 28e4f1a into cloudfoundry:develop Jan 27, 2023
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.

5 participants