Skip to content

Commit

Permalink
ensured formatting checks are part of tests, addressed two files that…
Browse files Browse the repository at this point in the history
… would have caused failures. (#47)
  • Loading branch information
jsoverson authored Jul 18, 2022
1 parent a777c02 commit c8e1f16
Show file tree
Hide file tree
Showing 6 changed files with 481 additions and 556 deletions.
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ clean: ## Remove generated artifacts and files
done
cargo clean

.PHONY: install-release deps
.PHONY: install-release
install-release: $(CORE_BINS) ## Build optimized binaries and install them to your local cargo bin
cargo build --workspace --release
cp build/local/* ~/.cargo/bin/

.PHONY: install deps
.PHONY: install
install: $(CORE_BINS) ## Build binaries and install them to your local cargo bin
cargo build --workspace
cp build/local/* ~/.cargo/bin/
Expand Down Expand Up @@ -121,13 +121,15 @@ wasm: $(TEST_WASM) $(TEST_WASI) $(TEST_MAIN_COMP) $(TEST_MAIN_NETWORK_COMP) ##

.PHONY: test
test: codegen wasm $(TEST_PAR) ## Run tests for the entire workspace
cargo +nightly fmt --check
cargo deny check licenses --hide-inclusion-graph
cargo build --workspace # necessary to ensure binaries are built
cargo test --workspace -- --skip integration_test
cargo test --workspace --manifest-path crates/wasmflow/wasmflow-sdk/Cargo.toml -- --skip integration_test

.PHONY: test-integration
test-integration: codegen wasm $(TEST_PAR) ## Run all tests for the workspace, including tests that rely on external services
cargo +nightly fmt --check
cargo deny check licenses --hide-inclusion-graph
cargo build --workspace # necessary to ensure binaries are built
NATS_URL=$(NATS_URL) cargo test --workspace
Expand All @@ -141,15 +143,6 @@ test-bins: codegen wasm $(TEST_PAR) ## Run tests for the main binaries
update-lint: ## Update the lint configuration for rust projects
npm run update-lint

.PHONY: build-tag
build-tag: ## Tag a build for release
ifeq ($(shell git status -s),)
@echo Tagging build-$$(date "+%Y-%m-%d")
@git tag build-$$(date "+%Y-%m-%d") -f
else
@echo "Check in changes before making a build tag."
endif

.PHONY: bins
bins: ./build/$(ARCH) ## Build binaries (supports ARCH & RELEASE env variables)
@echo "Building ARCH=$(ARCH) RELEASE=$(RELEASE)"
Expand Down
2 changes: 1 addition & 1 deletion codegen/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wasmflow codegen

This is the official code generation utility for [Wasmflow](https://wasmflow.com) components and providers.
This is the official code generation utility for [Wasmflow](https://wasmflow.com) components and collections.

## Installation

Expand Down
1 change: 1 addition & 0 deletions crates/bins/wasmflow/src/commands/list/wasm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions crates/wasmflow/wasmflow-manifest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ codegen:
@$(MAKE) json-schema/manifest.json
@$(MAKE) docs/v0.html
@$(MAKE) docs/v1.html
@cargo +nightly fmt

json-schema/manifest.json: json-schema/v0/manifest.json json-schema/v1/manifest.json
@jq \
Expand Down
8 changes: 8 additions & 0 deletions crates/wasmflow/wasmflow-rpc/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::process::Command;

fn main() {
println!("cargo:rerun-if-changed=proto/wasmflow.proto");
println!("cargo:rustc-env=OUT_DIR=generated");
Expand All @@ -6,4 +8,10 @@ fn main() {
.file_descriptor_set_path("src/generated/descriptors.bin")
.compile(&["proto/wasmflow.proto"], &["proto"])
.unwrap();

let fmt = Command::new("cargo")
.args(&["+nightly", "fmt", "--", "src/generated/wasmflow.rs"])
.status()
.expect("Failed to run cargo fmt on generated protobuf files.");
assert!(fmt.success(), "Can't format protobuf files");
}
Loading

0 comments on commit c8e1f16

Please sign in to comment.