Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples to spin registry CLI commands, added Windows override to Makefile #2135

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e-testing/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ impl AppMetadata {
}
}

Err("requested route not found").map_err(anyhow::Error::msg)
Err(anyhow::Error::msg("requested route not found"))
}
}
7 changes: 5 additions & 2 deletions src/commands/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <registry>/<username>/<application-name>:<version>. E.g. ghcr.io/ogghead/spin-test-app:0.1.0
#[clap()]
pub reference: String,
}
Expand Down Expand Up @@ -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 <registry>/<username>/<application-name>:<version>. E.g. ghcr.io/ogghead/spin-test-app:0.1.0
#[clap()]
pub reference: String,
}
Expand Down Expand Up @@ -126,6 +128,7 @@ pub struct Login {
)]
pub password_stdin: bool,

/// OCI registry server (e.g. ghcr.io)
#[clap()]
pub server: String,
}
Expand Down