sql_logic_test.py 1.5 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. from materialize.mzcompose import (
  10. get_default_system_parameters,
  11. )
  12. from materialize.mzcompose.service import (
  13. Service,
  14. )
  15. class SqlLogicTest(Service):
  16. def __init__(
  17. self,
  18. name: str = "sqllogictest",
  19. mzbuild: str = "sqllogictest",
  20. environment: list[str] | None = None,
  21. volumes: list[str] = ["../..:/workdir"],
  22. ) -> None:
  23. if environment is None:
  24. environment = [
  25. "MZ_SOFT_ASSERTIONS=1",
  26. "LD_PRELOAD=libeatmydata.so",
  27. ]
  28. environment += [
  29. "MZ_SYSTEM_PARAMETER_DEFAULT="
  30. + ";".join(
  31. [
  32. f"{key}={value}"
  33. for key, value in get_default_system_parameters().items()
  34. ]
  35. + ["enable_lgalloc=false"]
  36. )
  37. ]
  38. super().__init__(
  39. name=name,
  40. config={
  41. "mzbuild": mzbuild,
  42. "environment": environment,
  43. "volumes": volumes,
  44. "tmpfs": ["/tmp"],
  45. "propagate_uid_gid": True,
  46. "init": True,
  47. },
  48. )