Package integration provides functionality that needs to be shared between all integration tests.
Integration tests are implemented through Go's test framework, as test functions that create and execute pipelines using the ptest package. Tests should be placed in smaller sub-packages for organizational purposes and parallelism (tests are only run in parallel across different packages). Integration tests should always begin with a call to CheckFilters to ensure test filters can be applied, and each package containing integration tests should call ptest.Main in a TestMain function if it uses ptest.
Running integration tests can be done with a go test call with any flags that are required by the test pipelines, such as --runner or --endpoint. Example:
go test -v ./sdks/go/test/integration/... --runner=portable --endpoint=localhost:8099
Alternatively, tests can be executed by running the run_validatesrunner_tests.sh script, which also performs much of the environment setup, or by calling gradle commands in :sdks:go:test.
This section is empty.
var ( // TestExpansionAddr is the endpoint for the expansion service for test-only // cross-language transforms. TestExpansionAddr = flag.String("test_expansion_addr", "", "Address of Expansion Service for test cross-language transforms.") // IoExpansionAddr is the endpoint for the expansion service for // cross-language IO transforms. IoExpansionAddr = flag.String("io_expansion_addr", "", "Address of Expansion Service for cross-language IOs.") // BootstrapServers is the address of the bootstrap servers for a Kafka // cluster, used for Kafka IO tests. BootstrapServers = flag.String("bootstrap_servers", "", "URL of the bootstrap servers for the Kafka cluster. Should be accessible by the runner.") // KafkaJar is a filepath to a jar for starting a Kafka cluster, used for // Kafka IO tests. KafkaJar = flag.String("kafka_jar", "", "The filepath to a jar for starting up a Kafka cluster. Only used if boostrap_servers is unspecified.") )
The following flags are flags used in one or more integration tests, and that may be used by scripts that execute "go test ./sdks/go/test/integration/...". Because any flags used with those commands are used for each package, every integration test package must import these flags, even if they are not used.
func CheckFilters ¶
CheckFilters checks if an integration test is filtered to be skipped, either because the intended runner does not support it, or the test is sickbayed. This method should be called at the beginning of any integration test. If t.Run is used, CheckFilters should be called within the t.Run callback, so that sub-tests can be skipped individually.
This section is empty.
Source Files ¶
The integration driver provides a suite of tests to run against a registered runner.
|The integration driver provides a suite of tests to run against a registered runner.|
Package kafka contains integration tests for cross-language Kafka IO transforms.
|Package kafka contains integration tests for cross-language Kafka IO transforms.|
Package synthetic contains pipelines for testing synthetic steps and sources.
|Package synthetic contains pipelines for testing synthetic steps and sources.|
Package wordcount contains transforms for wordcount.
|Package wordcount contains transforms for wordcount.|
Package xlang contains integration tests for cross-language transforms.
|Package xlang contains integration tests for cross-language transforms.|