Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Use release binary in integration tests#98

Merged
cmoog merged 1 commit intomasterfromfix-coder-cli-test-binary
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletionsci/integration/setup_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,11 +32,14 @@ func init() {

// build the coder-cli binary and move to the integration testing bin directory
func build(path string) error {
tar := fmt.Sprintf("coder-cli-linux-amd64.tar.gz")
dir := filepath.Dir(path)
cmd := exec.Command(
"sh", "-c",
fmt.Sprintf("cd ../../ && go build -o %s ./cmd/coder", path),
fmt.Sprintf(
"cd ../../ && mkdir -p %s && ./ci/steps/build.sh && cp ./ci/bin/%s %s/ && tar -xzf %s -C %s",
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you just pulled the go build command into its own function and source it so you can call it? Would remove the step of tar -> untar

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'd prefer it to use as close to the actual release artifact as possible. Maybe that's not particularly rational in this case but the aim of this test is to prevent the previous regression from going undetected.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense

dir, tar, dir, filepath.Join(dir, tar), dir),
)
cmd.Env = append(os.Environ(), "GOOS=linux", "CGO_ENABLED=0")

out, err := cmd.CombinedOutput()
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletionsci/steps/build.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,6 @@ cd "$(dirname "$0")"
export GOARCH=amd64
tag=$(git describe --tags)

mkdir -p bin

build(){
tmpdir=$(mktemp -d)
go build -ldflags "-X main.version=${tag}" -o "$tmpdir/coder" ../../cmd/coder
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp