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

Allow using go test -c as build command #1103

Closed
wants to merge 1 commit into from

Conversation

y-tajiri
Copy link

#96
This isssue has been stopped, but I made a preliminary draft.

ko build --test import-path

will use go test -c instead of go build.

@hermanbanken
Copy link

Would be very interested in using this. I was just searching the docs of Ko for this, and also searching whether I can get the same kind of output with go build as I could with go test -c, which apparently is not possible. So having ko build --test would REALLY be great!

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

This looks pretty good so far. I'd like to think about whether this warrants a separate ko test ./pkg/foo surface. I'm still not sure I understand the use case well enough to have a strong opinion, but I'd love to learn.

Aside from that I think we'll need an e2e test that exercises this path, probably starting by having the ./test package have a foo_test.go in it, and doing a ko build --test ./test that runs the test.

We'll also want some docs to describe how this works, why you'd want to use it, etc.

This change as-is looks like a good start, thanks for picking it up so long after the issue went cold.

@@ -32,6 +32,9 @@ type gobuilds struct {

// workingDirectory is typically ".", but it may be a different value if ko is embedded as a library.
workingDirectory string

// ignore supported reference
ignoreSupportedReference bool
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be unused.

Copy link

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants