2017-07-23 20:12:17 +02:00
|
|
|
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
|
|
|
|
|
|
|
|
package examples
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
2017-08-06 17:26:20 +02:00
|
|
|
"github.com/pulumi/pulumi-fabric/pkg/testing/integration"
|
2017-07-23 20:12:17 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestExamples(t *testing.T) {
|
|
|
|
cwd, err := os.Getwd()
|
|
|
|
if !assert.NoError(t, err, "expected a valid working directory: %v", err) {
|
|
|
|
return
|
|
|
|
}
|
2017-08-06 17:26:20 +02:00
|
|
|
examples := []integration.LumiProgramTestOptions{
|
|
|
|
{
|
|
|
|
Dir: path.Join(cwd, "basic/minimal"),
|
|
|
|
Dependencies: []string{
|
|
|
|
"@lumi/lumirt",
|
|
|
|
"@lumi/lumi",
|
|
|
|
},
|
2017-07-23 20:12:17 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
for _, ex := range examples {
|
|
|
|
example := ex
|
2017-08-06 17:26:20 +02:00
|
|
|
t.Run(example.Dir, func(t *testing.T) {
|
|
|
|
integration.LumiProgramTest(t, example)
|
2017-07-23 20:12:17 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|