fivetran_destination_tester.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. from materialize.mzcompose.service import Service
  10. class FivetranDestinationTester(Service):
  11. def __init__(
  12. self,
  13. destination_host: str,
  14. destination_port: int,
  15. environment_extra: list[str] = [],
  16. volumes_extra: list[str] = [],
  17. ) -> None:
  18. environment = [
  19. f"GRPC_HOSTNAME={destination_host}",
  20. *environment_extra,
  21. ]
  22. command = [f"--port={destination_port}", "--tester-type=destination"]
  23. super().__init__(
  24. name="fivetran-destination-tester",
  25. config={
  26. "mzbuild": "fivetran-destination-tester",
  27. "command": command,
  28. "environment": environment,
  29. "volumes": volumes_extra,
  30. },
  31. )