mzcompose.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. """
  10. Test the output consistency of different query evaluation strategies (e.g.,
  11. dataflow rendering and constant folding).
  12. """
  13. from materialize.mzcompose.composition import Composition, WorkflowArgumentParser
  14. from materialize.mzcompose.services.materialized import Materialized
  15. from materialize.mzcompose.services.mz import Mz
  16. from materialize.mzcompose.services.postgres import CockroachOrPostgresMetadata
  17. from materialize.mzcompose.test_result import FailedTestExecutionError
  18. from materialize.output_consistency.execution.query_output_mode import QueryOutputMode
  19. from materialize.output_consistency.output_consistency_test import (
  20. OutputConsistencyTest,
  21. upload_output_consistency_results_to_test_analytics,
  22. )
  23. SERVICES = [
  24. CockroachOrPostgresMetadata(),
  25. Materialized(propagate_crashes=True, external_metadata_store=True),
  26. Mz(app_password=""),
  27. ]
  28. def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
  29. c.down(destroy_volumes=True)
  30. c.up("materialized")
  31. test = OutputConsistencyTest()
  32. args = test.parse_output_consistency_input_args(parser)
  33. default_connection = c.sql_connection()
  34. mz_system_connection = c.sql_connection(user="mz_system", port=6877)
  35. test_summary = test.run_output_consistency_tests(
  36. default_connection,
  37. mz_system_connection,
  38. args,
  39. query_output_mode=QueryOutputMode.SELECT,
  40. )
  41. upload_output_consistency_results_to_test_analytics(c, test_summary)
  42. if not test_summary.all_passed():
  43. raise FailedTestExecutionError(errors=test_summary.failures)