Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

CI runs the tests of the crates that need no GPU or media device, and two of their tests hold on any build (#90)

shinyobjectz6e79971b12a0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 41943c00..43e4e491 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -113,4 +113,7 @@ jobs:
- name: cargo check
run: cargo check --locked -p raea-cli --tests
- name: unit tests (the crates with no GPU or media device)
- run: cargo test --locked -p raea-io-media -p raea-core-fonts -p raea-native
+ # debug info off: with it the test binaries of the app crates filled 27 GB of a runner's disk (#90)
+ env:
+ CARGO_PROFILE_TEST_DEBUG: "0"
+ run: cargo test --locked -p raea-io-media -p raea-core-fonts -p raea-native -p raea-core-brief -p raea-core-k -p raea-bundle -p raea-app-check -p raea-app-workspace -p raea-app-tools -p raea-app-targets
diff --git a/apps/workspace/src/tests.rs b/apps/workspace/src/tests.rs
index ca1f0a05..8dbdab1f 100644
--- a/apps/workspace/src/tests.rs
+++ b/apps/workspace/src/tests.rs
@@ -10,7 +10,14 @@ fn a_name_is_its_folder() {
fn a_spec_module_is_tidy_typescript() {
// keys unquoted where they can be, nulls and empty lists left out, whole numbers whole, short string lists inline
let v = json!({"id": "delivery", "help": null, "tags": [], "n": 45.0, "options": ["9:16", "16:9"], "odd-key": 1});
- assert_eq!(ts_literal(&v, 0), "{\n id: \"delivery\",\n n: 45,\n \"odd-key\": 1,\n options: [\"9:16\", \"16:9\"],\n}");
+ // the keys' order is serde_json's: sorted on its own, as written when a crate built alongside turns on
+ // preserve_order (raea-cli does), so the lines are held as a set (#90)
+ fn lines(s: &str) -> Vec<&str> {
+ let mut l: Vec<&str> = s.lines().collect();
+ l.sort_unstable();
+ l
+ }
+ assert_eq!(lines(&ts_literal(&v, 0)), lines("{\n id: \"delivery\",\n n: 45,\n \"odd-key\": 1,\n options: [\"9:16\", \"16:9\"],\n}"));
}
#[test]
diff --git a/engine/bundle/tests/bundle.rs b/engine/bundle/tests/bundle.rs
index a837bd34..f7164ec1 100644
--- a/engine/bundle/tests/bundle.rs
+++ b/engine/bundle/tests/bundle.rs
@@ -104,9 +104,12 @@ fn bundles_a_script_with_the_engines_resolution() {
w("js/shims/node/zlib.ts", "export const gzip = () => 'ZLIB_SHIM';\n");
w("js/node_modules/react/package.json", r#"{ "name": "react", "main": "index.js" }"#);
w("js/node_modules/react/index.js", "export const version = 'ENGINE_REACT';\n");
- w("motion/index.tsx", "export const motion = 'MOTION_INDEX';\n");
- w("motion/ecs.ts", "export const ecs = 'MOTION_ECS';\n");
- w("motion/prelude.ts", "export const prelude = 'MOTION_PRELUDE';\n");
+ // the fake SDK laid out as the real one (sdk/raea/src under sdk/), with the import names in sdk/tsconfig.base.json's
+ // paths, which is where the resolver reads "raea" and "raea/<module>" from (script.rs, docs/sdk.feature S1d; #90)
+ w("sdk/raea/src/index.tsx", "export * from \"./prelude\";\nexport const motion = 'MOTION_INDEX';\n");
+ w("sdk/raea/src/ecs.ts", "export const ecs = 'MOTION_ECS';\n");
+ w("sdk/raea/src/prelude.ts", "export const prelude = 'MOTION_PRELUDE';\n");
+ w("sdk/tsconfig.base.json", r#"{ "compilerOptions": { "paths": { "raea": ["./raea/src/index.tsx"], "raea/*": ["./raea/src/*"] } } }"#);
w("lib/aliased.ts", "export const aliased = 'ALIASED';\n");
// the script's own folder carries another react: the engine's must win
w("work/node_modules/react/package.json", r#"{ "name": "react", "main": "index.js" }"#);
@@ -125,7 +128,7 @@ import { version } from "react";
"#);
let script = raea_bundle::script::Script {
js: d.join("js"),
- motion: d.join("motion"),
+ motion: d.join("sdk/raea/src"),
shell: d.join("nope.ts"),
aliases: [("~lib".to_string(), d.join("lib/aliased.ts"))].into_iter().collect(),
stubs: vec!["fs".into()],