MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / workflow_default

Function workflow_default

test/doc-examples/mzcompose.py:186–236  ·  view source on GitHub ↗
(c: Composition, parser: WorkflowArgumentParser)

Source from the content-addressed store, hash-verified

184
185
186def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
187 parser.add_argument(
188 "files",
189 nargs="*",
190 default=["*.yml"],
191 help="run against the specified files",
192 )
193 args = parser.parse_args()
194
195 c.up(
196 "fivetran-destination",
197 "materialized",
198 "postgres",
199 "mysql",
200 "minio",
201 "kafka",
202 "schema-registry",
203 "ssh-bastion-host",
204 "sql-server",
205 Service("testdrive", idle=True),
206 )
207
208 def process(file: pathlib.Path) -> None:
209 snippet = td_snippet(file)
210 if not snippet:
211 return
212 print(f"--- {posixpath.relpath(file, LOCATION)}")
213 junit_report = ci_util.junit_report_filename(str(file).replace("/", "_"))
214 c.testdrive(
215 snippet,
216 silent=True,
217 args=[f"--junit-report={junit_report}"],
218 caller=f"{file}:1",
219 )
220 # Uploading successful junit files wastes time and contains no useful information
221 os.remove(MZ_ROOT / "test" / "doc-examples" / junit_report)
222
223 files_unsharded: list[pathlib.Path] = []
224 for file in args.files:
225 new_files = list(LOCATION.rglob(file))
226 if not new_files:
227 known = "\n ".join(
228 [posixpath.relpath(file, LOCATION) for file in LOCATION.rglob("*.yml")]
229 )
230 raise ValueError(f'No files found matching "{file}", known:\n {known}')
231 files_unsharded.extend(new_files)
232 files: list[pathlib.Path] = buildkite.shard_list(
233 sorted(files_unsharded),
234 lambda file: str(file),
235 )
236 c.test_parts(files, process)

Callers

nothing calls this directly

Calls 7

ServiceClass · 0.90
ValueErrorClass · 0.85
test_partsMethod · 0.80
listFunction · 0.50
upMethod · 0.45
joinMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected