Skip to content

Configurable commands#117

Merged
nobu-k merged 3 commits into
sensorbee:masterfrom
disktnk:114-configurable-command
Oct 18, 2016
Merged

Configurable commands#117
nobu-k merged 3 commits into
sensorbee:masterfrom
disktnk:114-configurable-command

Conversation

@disktnk
Copy link
Copy Markdown
Member

@disktnk disktnk commented Sep 14, 2016

refs #114

@disktnk disktnk force-pushed the 114-configurable-command branch from a82145c to 68c63e1 Compare September 17, 2016 12:10
@disktnk
Copy link
Copy Markdown
Member Author

disktnk commented Sep 17, 2016

I fixed test code not to depend on order of map keys.

@disktnk disktnk force-pushed the 114-configurable-command branch 2 times, most recently from bb6b38d to a169e54 Compare September 18, 2016 16:00
Comment thread cmd/build_sensorbee/main.go Outdated
// TODO: sub commands should be configurable
if len(config.SubCommands) == 0 {
config.SubCommands = map[string]commandDetail{}
for _, sub := range sensorBeeDefaultCommands {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think everybody knows that this file is cmd/build_sensorbee/main.go, so defaultCommands should be ok.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

renamed the variable

So(string(b), ShouldEqual, expectedMainFile)
})
})
})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about adding a test using multiple SubCommands? It doesn't have to perform an exact match of the contents but only needs to look up substrings like repo1 "path/to/repo" (possibly with regexp) to see if all subcommands are correctly imported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I separate to 2 test cases.
1st., a created main file is exactly match or not when configuration includes a plugin and a command.
2nd., a created main file has custom-command string or not with command configurations.

@disktnk
Copy link
Copy Markdown
Member Author

disktnk commented Sep 27, 2016

On travis-ci test, go1.4.3 is failed to build, but the failure is not related to this PR. Latest ugorji/go includes a function which is added from go1.5~ ( ugorji/go@5099b68 ).

@nobu-k
Copy link
Copy Markdown
Member

nobu-k commented Sep 27, 2016

OK, let's set some official policy regarding which version of Go SensorBee supports. I think supporting latest three major versions (e.g. 1.7, 1.6, and 1.5 for now) is fine.

@nobu-k
Copy link
Copy Markdown
Member

nobu-k commented Sep 27, 2016

I mean, minor versions :)

@disktnk
Copy link
Copy Markdown
Member Author

disktnk commented Sep 28, 2016

I think your proposal is good and will make issue about supported versions of Go, thanks.

@nobu-k nobu-k merged commit 9f02ada into sensorbee:master Oct 18, 2016
@disktnk disktnk deleted the 114-configurable-command branch October 19, 2016 00:47
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