-
-
Notifications
You must be signed in to change notification settings - Fork 27
Add db open
command with Playbook
struct
#100
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
Conversation
8965890
to
cfde827
Compare
db open
command with Playbook
structdb open
command with Playbook
struct
f2ffae6
to
4fd83f3
Compare
4fd83f3
to
3f32c62
Compare
cmd/db_open_test.go
Outdated
defer trellis.LoadFixtureProject(t)() | ||
|
||
ui := cli.NewMockUi() | ||
mockProject := &MockProject{detected: true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're using LoadFixtureProject
you shouldn't need a mock project. The standard should work:
project := &trellis.Project{}
trellis := trellis.NewTrellis(project)
That goes for the test below too
cmd/db_opener_factory.go
Outdated
open(c DBCredentials) (err error) | ||
} | ||
|
||
func (f *DBOpenerFactory) make(app string, ui cli.Ui) (o DBOpener, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make
cmd/db_opener_factory.go
Outdated
type DBOpenerFactory struct{} | ||
|
||
type DBOpener interface { | ||
open(c DBCredentials) (err error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open
cmd/db_opener_factory.go
Outdated
return nil, fmt.Errorf("%s is not supported", app) | ||
} | ||
|
||
func (f *DBOpenerFactory) getSupportedApps() []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetSupportedApps
All set. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🎉
Continue #72 (which accidentally mereged and then reverted on #90)
Using
Playbook
struct from #91See: #7