github.com/docker/app@v0.9.1-beta3.0.20210611140623-a48f773ab002/e2e/example_test.go (about)

     1  package e2e
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  	"testing"
     7  
     8  	"gotest.tools/assert"
     9  	"gotest.tools/icmd"
    10  )
    11  
    12  func TestExamplesAreValid(t *testing.T) {
    13  	cmd, cleanup := dockerCli.createTestCmd()
    14  	defer cleanup()
    15  
    16  	err := filepath.Walk("../examples", func(p string, info os.FileInfo, err error) error {
    17  		if filepath.Ext(p) == ".dockerapp" {
    18  			t.Log("Validate example: " + p)
    19  			cmd.Command = dockerCli.Command("app", "validate", p)
    20  			icmd.RunCmd(cmd).Assert(t, icmd.Success)
    21  		}
    22  		return nil
    23  	})
    24  	assert.NilError(t, err)
    25  }