-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parser and executor: support Docker Builder (#179)
* TestViaRPC: a more user-friendly way to compare JSON's * Parser and executor: support Docker Builder * Only set auto_cancellation if it's true * Adopt new auto_cancellation behavior Co-authored-by: Fedor Korotkov <[email protected]> * $ go fmt * Fix TestAdditionalInstances and TestValidConfigs * Deduplicate task-related parser code into AttachBaseTaskFields() * Move defaults for Environment and Metadata into AttachBaseTaskFields() * TestDockerBuilderLinux: it's a "linux" named task, not script Co-authored-by: Fedor Korotkov <[email protected]>
- Loading branch information
Showing
64 changed files
with
847 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// +build linux | ||
|
||
package executor_test | ||
|
||
import ( | ||
"bytes" | ||
"github.com/cirruslabs/cirrus-cli/internal/executor" | ||
"github.com/cirruslabs/cirrus-cli/internal/testutil" | ||
"github.com/cirruslabs/echelon" | ||
"github.com/cirruslabs/echelon/renderers" | ||
"github.com/stretchr/testify/assert" | ||
"io" | ||
"os" | ||
"testing" | ||
) | ||
|
||
// TestDockerBuilderLinux ensures that Docker Builder instances using Linux platform are supported. | ||
func TestDockerBuilderLinux(t *testing.T) { | ||
// Create os.Stderr writer that duplicates it's output to buf | ||
buf := bytes.NewBufferString("") | ||
writer := io.MultiWriter(os.Stderr, buf) | ||
|
||
// Create a logger and attach it to writer | ||
renderer := renderers.NewSimpleRenderer(writer, nil) | ||
logger := echelon.NewLogger(echelon.TraceLevel, renderer) | ||
|
||
dir := testutil.TempDirPopulatedWith(t, "testdata/docker-builder") | ||
err := testutil.ExecuteWithOptionsNew(t, dir, executor.WithLogger(logger)) | ||
assert.NoError(t, err) | ||
assert.Contains(t, buf.String(), "I am running inside Docker Builder!") | ||
assert.Contains(t, buf.String(), "'linux' task succeeded") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
linux_docker_builder: | ||
platform: linux | ||
script: | ||
- echo "I am running inside Docker Builder!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.