pulumi/pkg/testing/integration
stack72 856c43d9c9 Extend integration test framework to allow test setup
This will allow us to run arbitrary commands to setup our tests
e.g. dotnet publish, or go build etc. The framework will allow steps
to be passed as follows:

```
func TestAccAwsCsLambda(t *testing.T) {
	test := getAWSBase(t).
		With(integration.ProgramTestOptions{
			Dir: path.Join(getCwd(t), "..", "..", "aws-cs-lambda"),
			TestPreSteps: map[string][]string{
				"dotnet": {
					"publish", "DotnetLambda/src/DotnetLambda/",
				},
			},
		})

	integration.ProgramTest(t, &test)
}
```

It will use the name in the map as the binary to use then will have
a list of args that get passed to the binary. We can see it will then
run the steps as follows:

```
[ /pulumi/examples/aws-cs-lambda ] running presteps in /var/folders/pz/y1yk28590l72qy1cmxrfndcw0000gn/T/p-it-demo-mbplo-aws-cs-lam-0993f109-318073945
[ /pulumi/examples/aws-cs-lambda ] **** Invoke '/usr/local/bin/dotnet publish DotnetLambda/src/DotnetLambda/' in '/var/folders/pz/y1yk28590l72qy1cmxrfndcw0000gn/T/p-it-demo-mbplo-aws-cs-lam-0993f109-318073945'
[ /pulumi/examples/aws-cs-lambda ] Wrote output to /var/folders/pz/y1yk28590l72qy1cmxrfndcw0000gn/T/p-it-demo-mbplo-aws-cs-lam-0993f109-318073945/command-output/dotnet-publish.20200504-000103.2b492.log
```
2020-05-04 00:06:25 +01:00
..
command.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
program.go Extend integration test framework to allow test setup 2020-05-04 00:06:25 +01:00
program_test.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
pulumi.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
s3reporter.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
util.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00