Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement docker executor and unit test #277

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
change maxTry to 100
colmazia committed Jan 5, 2023
commit ddf61047d3199431925c1c498b817b1e00dfab78
2 changes: 1 addition & 1 deletion yoda/executor/docker_test.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ func SetupDockerTest(t *testing.T) {
func TestDockerSuccess(t *testing.T) {
// TODO: Enable test when CI has docker installed.
// Prerequisite: please build docker image before running test
e := NewDockerExec("ongartbandprotocol/band-testing:python-runtime", 120*time.Second, 10, 5000, 5009)
e := NewDockerExec("ongartbandprotocol/band-testing:python-runtime", 120*time.Second, 100, 5000, 5009)
for i := 0; i < 20; i++ {
res, err := e.Exec([]byte(
"#!/usr/bin/env python3\nimport os\nimport sys\nprint(sys.argv[1], os.getenv('BAND_CHAIN_ID'))",
2 changes: 1 addition & 1 deletion yoda/executor/executor_test.go
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ func TestParseExecutorInvalidTimeoutError(t *testing.T) {

func TestExecuteDockerExecutorSuccess(t *testing.T) {
e, err := NewExecutor(
"docker:ongartbandprotocol/band-testing:python-runtime?timeout=120s&maxTry=10&portRange=5000-5009",
"docker:ongartbandprotocol/band-testing:python-runtime?timeout=120s&maxTry=100&portRange=5000-5009",
)
require.NoError(t, err)
for i := 0; i < 20; i++ {