diff --git a/Makefile b/Makefile index 85bc2e7bd..83c1f31b8 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ STARTD_SRC := core/startos/startd.service $(BUILD_SRC) COMPAT_SRC := $(shell git ls-files system-images/compat/) UTILS_SRC := $(shell git ls-files system-images/utils/) BINFMT_SRC := $(shell git ls-files system-images/binfmt/) -CORE_SRC := $(shell git ls-files core) $(shell git ls-files --recurse-submodules patch-db) web/dist/static web/patchdb-ui-seed.json $(GIT_HASH_FILE) +CORE_SRC := $(shell git ls-files -- core ':!:core/startos/bindings/*) $(shell git ls-files --recurse-submodules patch-db) web/dist/static web/patchdb-ui-seed.json $(GIT_HASH_FILE) WEB_SHARED_SRC := $(shell git ls-files web/projects/shared) $(shell ls -p web/ | grep -v / | sed 's/^/web\//g') web/node_modules web/config.json patch-db/client/dist web/patchdb-ui-seed.json WEB_UI_SRC := $(shell git ls-files web/projects/ui) WEB_SETUP_WIZARD_SRC := $(shell git ls-files web/projects/setup-wizard) @@ -88,7 +88,7 @@ format: cd core && cargo +nightly fmt test: $(CORE_SRC) $(ENVIRONMENT_FILE) - cd core && cargo build && cargo test + (cd core && cargo build && cargo test) npm --prefix sdk exec -- prettier -w ./core/startos/bindings/*.ts (cd sdk && make test) @@ -177,7 +177,7 @@ container-runtime/node_modules: container-runtime/package.json container-runtime core/startos/bindings: $(shell git ls-files -- core ':!:core/startos/bindings/*') $(ENVIRONMENT_FILE) rm -rf core/startos/bindings - (cd core/ && cargo test) + (cd core/ && cargo test --features=test) npm --prefix sdk exec -- prettier -w ./core/startos/bindings/*.ts sdk/lib/test: $(shell git ls-files sdk) core/startos/bindings diff --git a/core/startos/Cargo.toml b/core/startos/Cargo.toml index ec4e978bf..d1a333447 100644 --- a/core/startos/Cargo.toml +++ b/core/startos/Cargo.toml @@ -41,6 +41,7 @@ default = ["cli", "daemon"] dev = [] unstable = ["console-subscriber", "tokio/tracing"] docker = [] +test = [] [dependencies] aes = { version = "0.7.5", features = ["ctr"] } @@ -75,7 +76,7 @@ ed25519-dalek = { version = "2.1.1", features = [ "zeroize", "rand_core", "digest", - "pkcs8" + "pkcs8", ] } ed25519-dalek-v1 = { package = "ed25519-dalek", version = "1" } emver = { version = "0.1.7", git = "https://github.com/Start9Labs/emver-rs.git", features = [ diff --git a/core/startos/src/net/static_server.rs b/core/startos/src/net/static_server.rs index f7fc2969f..fa71672b3 100644 --- a/core/startos/src/net/static_server.rs +++ b/core/startos/src/net/static_server.rs @@ -14,7 +14,7 @@ use futures::future::ready; use http::header::ACCEPT_ENCODING; use http::request::Parts as RequestParts; use http::{HeaderMap, Method, StatusCode}; -use include_dir::{include_dir, Dir}; +use include_dir::Dir; use new_mime_guess::MimeGuess; use openssl::hash::MessageDigest; use openssl::x509::X509; @@ -37,10 +37,10 @@ const NOT_FOUND: &[u8] = b"Not Found"; const METHOD_NOT_ALLOWED: &[u8] = b"Method Not Allowed"; const NOT_AUTHORIZED: &[u8] = b"Not Authorized"; -#[cfg(all(feature = "daemon", not(test)))] +#[cfg(all(feature = "daemon", not(feature = "test")))] const EMBEDDED_UIS: Dir<'_> = include_dir::include_dir!("$CARGO_MANIFEST_DIR/../../web/dist/static"); -#[cfg(not(all(feature = "daemon", not(test))))] +#[cfg(not(all(feature = "daemon", not(feature = "test"))))] const EMBEDDED_UIS: Dir<'_> = Dir::new("", &[]); const PROXY_STRIP_HEADERS: &[&str] = &["cookie", "host", "origin", "referer", "user-agent"];