From d3dd9afdaf237fa39aa9a4286c2ad82408769ffd Mon Sep 17 00:00:00 2001 From: Darwin Boersma Date: Sun, 3 Dec 2023 15:07:39 -0700 Subject: [PATCH] Added examples to `spin registry` CLI commands, added Windows override to Makefile Signed-off-by: Darwin Boersma --- Makefile | 19 ++++++++++++------- crates/e2e-testing/src/metadata.rs | 2 +- src/commands/registry.rs | 7 +++++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 0942758bb2..7dfacad8d3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -LOG_LEVEL ?= spin=trace +LOG_LEVEL_VAR ?= RUST_LOG=spin=trace CERT_NAME ?= local SPIN_DOC_NAME ?= new-doc.md export PATH := target/debug:target/release:$(HOME)/.cargo/bin:$(PATH) @@ -41,6 +41,11 @@ ifeq ($(shell uname -s),Darwin) E2E_BUILD_SPIN = true endif +## overrides for Windows +ifeq ($(OS),Windows_NT) + LOG_LEVEL_VAR = +endif + .PHONY: build build: cargo build --release @@ -82,15 +87,15 @@ update-cargo-locks: .PHONY: test-unit test-unit: - RUST_LOG=$(LOG_LEVEL) cargo test --all --no-fail-fast -- --skip integration_tests --skip spinup_tests --skip cloud_tests --nocapture + $(LOG_LEVEL_VAR) cargo test --all --no-fail-fast -- --skip integration_tests --skip spinup_tests --skip cloud_tests --nocapture .PHONY: test-crate test-crate: - RUST_LOG=$(LOG_LEVEL) cargo test -p $(crate) --no-fail-fast -- --skip integration_tests --skip spinup_tests --skip cloud_tests --nocapture + $(LOG_LEVEL_VAR) cargo test -p $(crate) --no-fail-fast -- --skip integration_tests --skip spinup_tests --skip cloud_tests --nocapture .PHONY: test-integration test-integration: test-kv test-sqlite - RUST_LOG=$(LOG_LEVEL) cargo test --test integration --no-fail-fast -- --skip spinup_tests --skip cloud_tests --nocapture + $(LOG_LEVEL_VAR) cargo test --test integration --no-fail-fast -- --skip spinup_tests --skip cloud_tests --nocapture .PHONY: test-spin-up test-spin-up: build-test-spin-up run-test-spin-up @@ -107,15 +112,15 @@ run-test-spin-up: .PHONY: test-kv test-kv: build - PATH=$$(pwd)/target/release:$$PATH RUST_LOG=$(LOG_LEVEL) cargo test --test spinup_tests --features e2e-tests --no-fail-fast -- spinup_tests::key_value --nocapture + PATH=$$(pwd)/target/release:$$PATH $(LOG_LEVEL_VAR) cargo test --test spinup_tests --features e2e-tests --no-fail-fast -- spinup_tests::key_value --nocapture .PHONY: test-sqlite test-sqlite: build - PATH=$$(pwd)/target/release:$$PATH RUST_LOG=$(LOG_LEVEL) cargo test --test spinup_tests --features e2e-tests --no-fail-fast -- spinup_tests::sqlite --nocapture + PATH=$$(pwd)/target/release:$$PATH $(LOG_LEVEL_VAR) cargo test --test spinup_tests --features e2e-tests --no-fail-fast -- spinup_tests::sqlite --nocapture .PHONY: test-config-provider test-config-provider: - RUST_LOG=$(LOG_LEVEL) cargo test --test integration --features config-provider-tests --no-fail-fast -- integration_tests::config_provider_tests --nocapture + $(LOG_LEVEL_VAR) cargo test --test integration --features config-provider-tests --no-fail-fast -- integration_tests::config_provider_tests --nocapture .PHONY: test-sdk-go test-sdk-go: diff --git a/crates/e2e-testing/src/metadata.rs b/crates/e2e-testing/src/metadata.rs index 5d2c18ff52..d21e92c61d 100644 --- a/crates/e2e-testing/src/metadata.rs +++ b/crates/e2e-testing/src/metadata.rs @@ -23,6 +23,6 @@ impl AppMetadata { } } - Err("requested route not found").map_err(anyhow::Error::msg) + Err(anyhow::Error::msg("requested route not found")) } } diff --git a/src/commands/registry.rs b/src/commands/registry.rs index 41a8901810..8d858c9785 100644 --- a/src/commands/registry.rs +++ b/src/commands/registry.rs @@ -53,7 +53,8 @@ pub struct Push { #[clap(long, takes_value = false, env = ALWAYS_BUILD_ENV)] pub build: bool, - /// Reference of the Spin application + /// Reference in the registry of the Spin application. + /// This is a string whose format is defined by the registry standard, and generally consists of //:. E.g. ghcr.io/ogghead/spin-test-app:0.1.0 #[clap()] pub reference: String, } @@ -90,7 +91,8 @@ pub struct Pull { )] pub insecure: bool, - /// Reference of the Spin application + /// Reference in the registry of the published Spin application. + /// This is a string whose format is defined by the registry standard, and generally consists of //:. E.g. ghcr.io/ogghead/spin-test-app:0.1.0 #[clap()] pub reference: String, } @@ -126,6 +128,7 @@ pub struct Login { )] pub password_stdin: bool, + /// OCI registry server (e.g. ghcr.io) #[clap()] pub server: String, }