Skip to content

Commit

Permalink
Merge pull request #44 from kudulab/2025-new-e2e-images
Browse files Browse the repository at this point in the history
2025 new e2e images
  • Loading branch information
xmik authored Dec 29, 2024
2 parents 8099f92 + b0b399b commit d978b5c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 0.13.3 (2024-Dec-29)

* use newer images for e2e tests
* print docker and docker-compose version at the start of a dojo run
* print debug output about local env vars

### 0.13.2 (2024-Dec-29)

* fix the automated GitHub release
Expand Down
2 changes: 1 addition & 1 deletion Dojofile.e2e-alpine
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DOJO_DOCKER_IMAGE="kudulab/inception-dojo:alpine-0.6.1"
DOJO_DOCKER_IMAGE="kudulab/inception-dojo:alpine-0.7.0"
DOJO_DOCKER_OPTIONS="--privileged"
2 changes: 1 addition & 1 deletion Dojofile.e2e-ubuntu
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DOJO_DOCKER_IMAGE="kudulab/inception-dojo:ubuntu-0.6.1"
DOJO_DOCKER_IMAGE="kudulab/inception-dojo:ubuntu-0.7.0"
DOJO_DOCKER_OPTIONS="--privileged"
11 changes: 11 additions & 0 deletions docker_compose_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,17 @@ func checkIfAnyContainerFailed(nonDefaultContainerInfos []*ContainerInfo, defaul
return anyContainerFailed
}

func (d DockerComposeDriver) PrintVersion() {
version_cmd := "docker-compose --version"
stdout, stderr, exitStatus, _ := d.ShellService.RunGetOutput(version_cmd, true)
if exitStatus != 0 {
cmdInfo := cmdInfoToString(version_cmd, stdout, stderr, exitStatus)
d.Logger.Log("debug", cmdInfo)
} else {
d.Logger.Log("info", stdout)
}
}

func (dc DockerComposeDriver) HandleRun(mergedConfig Config, runID string, envService EnvServiceInterface) int {
warnGeneral(dc.FileService, mergedConfig, envService, dc.Logger)
envFile, envFileMultiLine, envFileBashFunctions := getEnvFilePaths(runID, mergedConfig.Test)
Expand Down
11 changes: 11 additions & 0 deletions docker_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ func (d DockerDriver) ConstructDockerRunCmd(config Config, envFilePath string, e
return cmd
}

func (d DockerDriver) PrintVersion() {
version_cmd := "docker --version"
stdout, stderr, exitStatus, _ := d.ShellService.RunGetOutput(version_cmd, true)
if exitStatus != 0 {
cmdInfo := cmdInfoToString(version_cmd, stdout, stderr, exitStatus)
d.Logger.Log("debug", cmdInfo)
} else {
d.Logger.Log("info", stdout)
}
}

func (d DockerDriver) HandleRun(mergedConfig Config, runID string, envService EnvServiceInterface) int {
warnGeneral(d.FileService, mergedConfig, envService, d.Logger)
envFile, envFileMultiLine, envFileBashFunctions := getEnvFilePaths(runID, mergedConfig.Test)
Expand Down
3 changes: 2 additions & 1 deletion driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import "fmt"

type DojoDriverInterface interface {
PrintVersion()
HandleRun(mergedConfig Config, runID string, envService EnvServiceInterface) int
CleanAfterRun(mergedConfig Config, runID string) int
HandlePull(mergedConfig Config) int
Expand All @@ -27,4 +28,4 @@ func warnGeneral(fileService FileServiceInterface, config Config, envService Env
if envService.IsCurrentUserRoot() {
logger.Log("warn", "Current user is root, which is not recommended")
}
}
}
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func main() {
// set the DOJO_LOG_LEVEL now,
// so that its value is preserved to docker containers
envService.AddVariable(fmt.Sprintf("DOJO_LOG_LEVEL=%s", mergedConfig.LogLevel))
logger.Log("debug", fmt.Sprintf("Local enviroment variables: %s", envService.GetVariables()))

shellService.SetEnvironment(envService.GetVariables())

Expand All @@ -119,6 +120,8 @@ func main() {

// main work goroutine
go func() {
// print the version of docker or docker-compose
driver.PrintVersion()
// run and stop the containers
exitstatus := driver.HandleRun(mergedConfig, runID, envService)
doneChannel <- exitstatus
Expand Down
3 changes: 1 addition & 2 deletions test/test-files/DirWithUpperCaseLetters/itest-dc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2.2'
services:
default:
# this option is needed to make default docker container preserve signals,
Expand All @@ -19,4 +18,4 @@ services:
# short-running command
# command: ["true"]
# long running command
command: ["while true; do sleep 1d; done;"]
command: ["while true; do sleep 1d; done;"]
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main
const DojoVersion = "0.13.2"
const DojoVersion = "0.13.3"

0 comments on commit d978b5c

Please sign in to comment.