test_full_testdrive.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. import argparse
  10. import glob
  11. import pytest
  12. from materialize import MZ_ROOT, buildkite
  13. from materialize.cloudtest.app.materialize_application import MaterializeApplication
  14. @pytest.mark.long
  15. def test_full_testdrive(mz: MaterializeApplication) -> None:
  16. parser = argparse.ArgumentParser(
  17. prog="test-full-testdrive",
  18. formatter_class=argparse.RawDescriptionHelpFormatter,
  19. )
  20. parser.add_argument("--file-pattern", default="*.td", type=str)
  21. args, _ = parser.parse_known_args()
  22. matching_files = sorted(
  23. glob.glob(f"testdrive/{args.file_pattern}", root_dir=MZ_ROOT / "test")
  24. )
  25. # TODO: database-issues#7827 (test requires fivetran running in cloudtest)
  26. matching_files.remove("testdrive/fivetran-destination.td")
  27. sharded_files = buildkite.shard_list(matching_files, lambda file: file)
  28. print(f"Files: {sharded_files}")
  29. mz.testdrive.copy("test/testdrive", "/workdir")
  30. mz.testdrive.run("--var=uses-redpanda=True", *sharded_files)