vc-runtime 0.1.0

Runtime backend for Visual Compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Shared test utilities for backend module.

#[cfg(all(test, feature = "comfy-renderer"))]
use crate::services::comfy::{ValidatedWorkflowTemplate, WorkflowLoader};
#[cfg(all(test, feature = "comfy-renderer"))]
use std::path::PathBuf;

/// Creates a valid workflow template from the fixture file.
#[cfg(all(test, feature = "comfy-renderer"))]
pub fn create_test_template() -> ValidatedWorkflowTemplate {
    let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
    let path = manifest_dir.join("..").join("fixtures").join("comfy").join("workflow_base.json");
    let raw = WorkflowLoader::load(&path).expect("failed to load test workflow");
    ValidatedWorkflowTemplate::new(raw).expect("failed to validate test workflow")
}