Skip to content

Commit

Permalink
cli: adds --timeout flag to check subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
ivotron committed May 9, 2017
1 parent eeb6e18 commit 8411d75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions popper/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
var environment []string
var volumes []string
var skip string
var timeout string
var checksh = `#!/bin/bash
set -e
type docker >/dev/null 2>&1 || { echo >&2 "Can't find docker command."; exit 1; }
Expand Down Expand Up @@ -40,7 +41,7 @@ docker run --rm -i %s \
--volume $docker_path:/usr/bin/docker \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir $PWD \
ivotron/popperci-experimenter %s
ivotron/popperci-experimenter %s %s
echo "Popper check finished"
echo "status: $(cat popper_status)"
`
Expand All @@ -56,9 +57,9 @@ func writePopperCheckScript() {
}
var content string
if len(skip) > 0 {
content = fmt.Sprintf(checksh, env, "--skip "+skip)
content = fmt.Sprintf(checksh, env, "--timeout "+timeout, "--skip "+skip)
} else {
content = fmt.Sprintf(checksh, env, "")
content = fmt.Sprintf(checksh, env, "--timeout "+timeout, "")
}
err := ioutil.WriteFile("/tmp/poppercheck", []byte(content), 0755)
if err != nil {
Expand Down Expand Up @@ -87,4 +88,5 @@ func init() {
checkCmd.Flags().StringSliceVarP(&environment, "environment", "e", []string{}, "Environment variables to be defined inside the test container.")
checkCmd.Flags().StringSliceVarP(&volumes, "volume", "v", []string{}, "Volumes to be passed to the test container.")
checkCmd.Flags().StringVarP(&skip, "skip", "s", "", "Comma-separated list of stages to skip.")
checkCmd.Flags().StringVarP(&timeout, "timeout", "t", "36000", "Timeout limit for experiment (default: 10 hrs).")
}

0 comments on commit 8411d75

Please sign in to comment.