THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- All integration tests should be in a subpackage, not in the root
integration
package. - Integration tests should be executing pipelines with
ptest.Run()
. Tests that do not execute pipelines likely do not belong as integration tests.- If this is a new package, it's required that
TestMain(m *testing.M)
is defined and callsptest.Main(m)
.
- If this is a new package, it's required that
- The integration package defines a way to enable test filtering for your integration test. All integration tests should have test filtering enabled.
- The test filter will fail the test in the event
TestMain
doesn't callptest.Main
.
- The test filter will fail the test in the event
Running Tests
- Manually: Tests can be run manually with the usual go test command by including any necessary flags. This approach is useful for running specific tests, but it requires any necessary services, such as job servers and cross-language expansion services, to be available with endpoints to use. For example:
go test -v ./sdks/go/test/integration/... --runner=portable --endpoint=localhost:8099
- Script: The script
beam/sdks/go/test/run_validatesrunner_tests.sh
can be run to provide some automation, and is more convenient for running a runner with more complex configuration, such as Dataflow. - Gradle: There are gradle tasks to build required services and run the script in
beam/sdks/go/test/build.gradle
. This approach is recommended for a convenient way of running the full integration test suite on a single runner. For example:./gradlew :clean :sdks:go:test:ulrValidatesRunner
...