Skip to content

Commit

Permalink
chore: forgot test dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt committed Nov 2, 2023
1 parent 70313d4 commit 173364b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- checkout
- setup_remote_docker:
version: 19.03.13
version: 20.10.7
- run:
name: Run tests
command: |
Expand All @@ -53,11 +53,11 @@ jobs:

integration:
docker:
- image: circleci/golang:1.17
- image: cimg/go:1.21.3
steps:
- checkout
- setup_remote_docker:
version: 19.03.13
version: 20.10.7
- run:
name: Install commander
command: |
Expand Down
9 changes: 4 additions & 5 deletions integration/containers/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM golang:1.17
FROM golang:1.21-bullseye

RUN mkdir -p $GOPATH/github.com/commander/commander-cli

# For some reason circleci will not mount the dir?
COPY . $GOPATH/github.com/commander/commander-cli/
WORKDIR $GOPATH/github.com/commander/commander-cli/

RUN curl https://s3.amazonaws.com/codeclimate/test-reporter/test-reporter-0.10.1-linux-amd64 --output test-reporter
RUN chmod +x test-reporter
ADD https://s3.amazonaws.com/codeclimate/test-reporter/test-reporter-0.10.1-linux-amd64 test-reporter
ADD https://github.com/commander-cli/commander/releases/download/v2.4.0/commander-linux-amd64 /usr/bin/commander
RUN chmod +x /usr/bin/commander && chmod +x test-reporter

RUN curl -L https://github.com/commander-cli/commander/releases/download/v2.4.0/commander-linux-amd64 --output /usr/bin/commander
RUN chmod +x /usr/bin/commander
4 changes: 2 additions & 2 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
CommanderFile = "commander.yaml"
)

//TestCommandContext holds all flags for the add command
// TestCommandContext holds all flags for the add command
type TestCommandContext struct {
Verbose bool
NoColor bool
Expand All @@ -22,7 +22,7 @@ type TestCommandContext struct {
Filters []string
}

//NewTestContextFromCli is a constructor which creates the context
// NewTestContextFromCli is a constructor which creates the context
func NewTestContextFromCli(c *cli.Context) TestCommandContext {
return TestCommandContext{
Verbose: c.Bool("verbose"),
Expand Down
4 changes: 2 additions & 2 deletions pkg/matcher/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ to contain
}
}

//EqualMatcher matches if given values are equal
// EqualMatcher matches if given values are equal
type EqualMatcher struct {
}

//Match matches the values if they are equal
// Match matches the values if they are equal
func (m EqualMatcher) Match(got interface{}, expected interface{}) MatcherResult {
if got == expected {
return MatcherResult{
Expand Down
6 changes: 3 additions & 3 deletions pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type TestCase struct {
Skip bool
}

//GlobalTestConfig represents the configuration for a test
// GlobalTestConfig represents the configuration for a test
type GlobalTestConfig struct {
Env map[string]string
Dir string
Expand All @@ -82,15 +82,15 @@ type CommandResult struct {
Error error
}

//Expected is the expected output of the command under test
// Expected is the expected output of the command under test
type Expected struct {
Stdout ExpectedOut
Stderr ExpectedOut
LineCount int
ExitCode int
}

//ExpectedOut represents the assertions on stdout and stderr
// ExpectedOut represents the assertions on stdout and stderr
type ExpectedOut struct {
Contains []string `yaml:"contains,omitempty"`
Lines map[int]string `yaml:"lines,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/suite/yaml_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func convertNodes(nodeConfs map[string]YAMLNodeConf) []runtime.Node {
return nodes
}

//Convert YAMLSuiteConf to runtime TestCases
// Convert YAMLSuiteConf to runtime TestCases
func convertYAMLSuiteConfToTestCases(conf YAMLSuiteConf, fileName string) []runtime.TestCase {
var tests []runtime.TestCase
for _, t := range conf.Tests {
Expand Down Expand Up @@ -196,7 +196,7 @@ func (y *YAMLSuiteConf) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil
}

//Converts given value to an ExpectedOut. Especially used for Stdout and Stderr.
// Converts given value to an ExpectedOut. Especially used for Stdout and Stderr.
func (y *YAMLSuiteConf) convertToExpectedOut(value interface{}) runtime.ExpectedOut {
exp := runtime.ExpectedOut{
JSON: make(map[string]string),
Expand Down Expand Up @@ -285,7 +285,7 @@ func (y *YAMLSuiteConf) convertToExpectedOut(value interface{}) runtime.Expected
return exp
}

//MarshalYAML adds custom logic to the struct to yaml conversion
// MarshalYAML adds custom logic to the struct to yaml conversion
func (y YAMLSuiteConf) MarshalYAML() (interface{}, error) {
//Detect which values of the stdout/stderr assertions should be filled.
//If all values are empty except Contains it will convert it to a single string
Expand Down

0 comments on commit 173364b

Please sign in to comment.