Skip to content

Commit

Permalink
Merge pull request #36 from codecrafters-io/Update-tester-utils-and-sys
Browse files Browse the repository at this point in the history
CC-1067 update tester-utils to v0.2.15
  • Loading branch information
libmartinito authored Mar 7, 2024
2 parents 9eb31c4 + 7355656 commit 00e2946
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 29 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/codecrafters-io/docker-tester
go 1.13

require (
github.com/codecrafters-io/tester-utils v0.2.10
github.com/codecrafters-io/tester-utils v0.2.15
github.com/fatih/color v1.16.0 // indirect
github.com/stretchr/testify v1.8.4
golang.org/x/sys v0.18.0 // indirect
gopkg.in/yaml.v2 v2.4.0
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/codecrafters-io/tester-utils v0.2.1 h1:+bdZLJhFMWcf+/E3C4NlGsIvxvsyBW
github.com/codecrafters-io/tester-utils v0.2.1/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.10 h1:Xpu6wzgpRpiZPFNGWMRcJXwAZZ0Yb5Mv6IDOR319f+s=
github.com/codecrafters-io/tester-utils v0.2.10/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.15 h1:d6lbr1nVkZ4+G55E47bG3bf1lWiMLOUZy5EiHwX2SsE=
github.com/codecrafters-io/tester-utils v0.2.15/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -34,6 +36,8 @@ golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
4 changes: 2 additions & 2 deletions internal/stage_basic_exec.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package internal

import (
tester_utils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/test_case_harness"
)

func testBasicExec(stageHarness *tester_utils.StageHarness) error {
func testBasicExec(stageHarness *test_case_harness.TestCaseHarness) error {
initRandom()

logger := stageHarness.Logger
Expand Down
4 changes: 2 additions & 2 deletions internal/stage_exit_code.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package internal

import (
tester_utils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/test_case_harness"
"strconv"
)

func testExitCode(stageHarness *tester_utils.StageHarness) error {
func testExitCode(stageHarness *test_case_harness.TestCaseHarness) error {
initRandom()

logger := stageHarness.Logger
Expand Down
4 changes: 2 additions & 2 deletions internal/stage_fetch_from_registry.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package internal

import (
tester_utils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/test_case_harness"
"strings"
)

func testFetchFromRegistry(stageHarness *tester_utils.StageHarness) error {
func testFetchFromRegistry(stageHarness *test_case_harness.TestCaseHarness) error {
logger := stageHarness.Logger
executable := stageHarness.Executable

Expand Down
4 changes: 2 additions & 2 deletions internal/stage_fs_isolation.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"path/filepath"
"strconv"

tester_utils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/test_case_harness"
)

func testFSIsolation(stageHarness *tester_utils.StageHarness) error {
func testFSIsolation(stageHarness *test_case_harness.TestCaseHarness) error {
initRandom()

logger := stageHarness.Logger
Expand Down
4 changes: 2 additions & 2 deletions internal/stage_process_isolation.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package internal

import tester_utils "github.com/codecrafters-io/tester-utils"
import "github.com/codecrafters-io/tester-utils/test_case_harness"

func testProcessIsolation(stageHarness *tester_utils.StageHarness) error {
func testProcessIsolation(stageHarness *test_case_harness.TestCaseHarness) error {
logger := stageHarness.Logger
executable := stageHarness.Executable

Expand Down
4 changes: 2 additions & 2 deletions internal/stage_stdio.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package internal

import (
tester_utils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/test_case_harness"
)

func testStdio(stageHarness *tester_utils.StageHarness) error {
func testStdio(stageHarness *test_case_harness.TestCaseHarness) error {
initRandom()

logger := stageHarness.Logger
Expand Down
32 changes: 16 additions & 16 deletions internal/tester_definition.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package internal

import (
testerutils "github.com/codecrafters-io/tester-utils"
"github.com/codecrafters-io/tester-utils/tester_definition"
)

var testerDefinition = testerutils.TesterDefinition{
AntiCheatTestCases: []testerutils.TestCase{},
var testerDefinition = tester_definition.TesterDefinition{
AntiCheatTestCases: []tester_definition.TestCase{},
ExecutableFileName: "your_docker.sh",
TestCases: []testerutils.TestCase{
TestCases: []tester_definition.TestCase{
{
Slug: "init",
TestFunc: testBasicExec,
Slug: "init",
TestFunc: testBasicExec,
},
{
Slug: "stdio",
TestFunc: testStdio,
Slug: "stdio",
TestFunc: testStdio,
},
{
Slug: "exit_code",
TestFunc: testExitCode,
Slug: "exit_code",
TestFunc: testExitCode,
},
{
Slug: "fs_isolation",
TestFunc: testFSIsolation,
Slug: "fs_isolation",
TestFunc: testFSIsolation,
},
{
Slug: "process_isolation",
TestFunc: testProcessIsolation,
Slug: "process_isolation",
TestFunc: testProcessIsolation,
},
{
Slug: "fetch_from_registry",
TestFunc: testFetchFromRegistry,
Slug: "fetch_from_registry",
TestFunc: testFetchFromRegistry,
},
},
}

0 comments on commit 00e2946

Please sign in to comment.