Skip to content

Add version command - #12

Merged
btromanova merged 8 commits into
masterfrom
add-version-command
Oct 2, 2019
Merged

btromanova merged 8 commits into
masterfrom
add-version-command

Conversation

@dansimau

@dansimau dansimau commented Dec 27, 2018 •

Copy link
Copy Markdown
Contributor

astro version will print the version of astro at the command line.
Version information will be set using ldflags at release time. For more
information, see:
https://stackoverflow.com/questions/11354518/golang-application-auto-build-versioning

Automated releases will be implemented in a separate PR (#14).

@dansimau dansimau self-assigned this Dec 27, 2018
Comment thread astro/cli/astro/cmd/cmds.go Resolved
dansimau and others added 3 commits September 27, 2019 14:21
`astro version` will print the version of astro at the command line.
Version information will be set using ldflags at release time. For more
information, see:
https://stackoverflow.com/questions/11354518/golang-application-auto-build-versioning

Automated releasing will be implemented in a separate PR.
@btromanova
btromanova force-pushed the add-version-command branch from 54691ae to ec8314c Compare October 2, 2019 10:03
Comment thread CHANGELOG.md Outdated
Comment on lines +6 to +10
* Propagate SIGINT and SIGTERM to terraform processes (#49)
* Support detach flag with terraform 0.12 (#45)
* Fix plan output for terraform 0.12 (#41)
* Fix bug in initialization of allowed values (#43)
* Don't pass varialbes to modules that don't delcare them (#40)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can we put this in a separate PR? They have nothing to do with this one.

(Also, typo: "variables")

Comment thread astro/cli/astro/cmd/version.go Outdated
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2018 Uber Technologies, Inc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

2019

Comment thread astro/tests/integration_test.go Outdated

// compiles the astro binary and returns the path to it.
func compileAstro(dir string) (string, error) {
func compileAstro(dir string, ldflags []string) (string, error) {

@dansimau dansimau Oct 2, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's just make this buildFlags []string and allow people to pass arbitrary flags.

Comment thread astro/tests/integration_test.go Outdated
Comment on lines +233 to +235
if err != nil {
panic(err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In tests just do:

require.NoError(t, err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done

Comment thread astro/tests/integration_test.go Outdated
Comment on lines +245 to +247
if err != nil {
panic(err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

require.NoError(t, err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done, thanks

Comment thread astro/tests/integration_test.go Outdated
assert.Equal(t, "astro version 1.2.3 (ab123) built 2019-01-01T10:00:00\n", stdoutBytes.String())
}

func TestPlanErorrsWithoutConfig(t *testing.T) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we test apply too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a test below.

@dansimau
dansimau removed the request for review from CorgiMan October 2, 2019 10:24
Comment thread astro/tests/integration_test.go Resolved
Comment thread astro/tests/integration_test.go Outdated
func TestApplyErorrsWithoutConfig(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "astro-tests")
require.NoError(t, err)
defer os.RemoveAll(dir)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same here.

You could also make these two tests into a table test (if you wanted... 😉 )

@dansimau dansimau left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM

@btromanova
btromanova merged commit bc39594 into master Oct 2, 2019
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.

2 participants