Deploy the current source to the cloud and run tests.
(c: Composition, parser: WorkflowArgumentParser)
| 221 | |
| 222 | |
| 223 | def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None: |
| 224 | """Deploy the current source to the cloud and run tests.""" |
| 225 | |
| 226 | parser.add_argument( |
| 227 | "--cleanup", |
| 228 | default=True, |
| 229 | action=argparse.BooleanOptionalAction, |
| 230 | help="Destroy the region at the end of the workflow.", |
| 231 | ) |
| 232 | parser.add_argument( |
| 233 | "--version-check", |
| 234 | default=True, |
| 235 | action=argparse.BooleanOptionalAction, |
| 236 | help="Perform a version check.", |
| 237 | ) |
| 238 | |
| 239 | parser.add_argument( |
| 240 | "td_files", |
| 241 | nargs="*", |
| 242 | default=["*.td"], |
| 243 | help="run against the specified files", |
| 244 | ) |
| 245 | |
| 246 | args = parser.parse_args() |
| 247 | |
| 248 | if not os.getenv("BUILDKITE_COMMIT"): |
| 249 | raise UIError( |
| 250 | "BUILDKITE_COMMIT must be set (and valid) when running cloud-canary" |
| 251 | ) |
| 252 | |
| 253 | files = list( |
| 254 | itertools.chain.from_iterable( |
| 255 | [ |
| 256 | glob.glob(file_glob, root_dir=MZ_ROOT / "test" / "cloud-canary") |
| 257 | for file_glob in args.td_files |
| 258 | ] |
| 259 | ) |
| 260 | ) |
| 261 | |
| 262 | if args.cleanup: |
| 263 | disable_region(c) |
| 264 | |
| 265 | try: |
| 266 | test_failed = True |
| 267 | print(f"Enabling region using Mz version {VERSION} ...") |
| 268 | try: |
| 269 | c.run("mz", "region", "enable", "--version", VERSION) |
| 270 | except UIError: |
| 271 | # Work around https://github.com/MaterializeInc/database-issues/issues/4989 |
| 272 | pass |
| 273 | |
| 274 | time.sleep(10) |
| 275 | |
| 276 | assert "materialize.cloud" in c.cloud_hostname() |
| 277 | wait_for_cloud(c) |
| 278 | |
| 279 | if args.version_check: |
| 280 | version_check(c) |
nothing calls this directly
no test coverage detected