MCPcopy Create free account
hub / github.com/dataform-co/dataform / addTestsToCompiledGraph

Method addTestsToCompiledGraph

core/session.ts:745–767  ·  view source on GitHub ↗
(actions: Action[])

Source from the content-addressed store, hash-verified

743 }
744
745 private addTestsToCompiledGraph(actions: Action[]) {
746 actions
747 .filter(action => action instanceof Test)
748 .map(test => test as Test)
749 .forEach(currentTest => {
750 const testTargets = this.indexedActions.find(currentTest.getTestTarget());
751 testTargets
752 .forEach(action => {
753 if (!(action instanceof Table || action instanceof View)) {
754 this.compileError(
755 new Error(
756 `Tests are only supported for Tables and Views. Action "${targetAsReadableString(action.getTarget())}" is not a table or view".`
757 ),
758 action.getFileName(),
759 action.getTarget()
760 );
761 }
762 });
763 testTargets
764 .map(action => action as Table | View)
765 .forEach(tableOrViewAction => tableOrViewAction.dependencies(utils.resolvableAsTarget(currentTest.getTarget())));
766 });
767 }
768
769 private removeNonUniqueActionsFromCompiledGraph(compiledGraph: dataform.CompiledGraph) {
770 function getNonUniqueTargets(targets: dataform.ITarget[]): Set<string> {

Callers 1

compileMethod · 0.95

Calls 7

compileErrorMethod · 0.95
targetAsReadableStringFunction · 0.90
findMethod · 0.80
getTestTargetMethod · 0.80
getTargetMethod · 0.45
getFileNameMethod · 0.45
dependenciesMethod · 0.45

Tested by

no test coverage detected