forked from kube-rs/kopium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert main change and improve testing experience
cannot do module level attributes because we don't know how users will consume the generated file. for example, the tests uses `include!` and that means the module level macro will not actually be at the top of the file. also don't really want to selectively add to all structs, let's just solve kube-rs#22 properly. Signed-off-by: clux <sszynrae@gmail.com>
- Loading branch information
Showing
4 changed files
with
36 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
NAME := "kopium" | ||
REPO := "kube-rs" | ||
VERSION := `git rev-parse HEAD` | ||
SEMVER_VERSION := `grep version Cargo.toml | awk -F"\"" '{print $2}' | head -n 1` | ||
|
||
default: | ||
@just --list --unsorted | grep -v " default" | ||
|
||
test: test-pr test-mv test-argo | ||
|
||
test-pr: | ||
kubectl apply --force-conflicts --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.52.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml | ||
cargo run --bin kopium -- prometheusrules.monitoring.coreos.com > tests/gen.rs | ||
echo "pub type CR = PrometheusRule;" >> tests/gen.rs | ||
kubectl apply -f tests/pr.yaml | ||
cargo test --test runner -- --nocapture | ||
|
||
test-mv: | ||
kubectl apply -f tests/mv-crd.yaml | ||
cargo run --bin kopium -- multiversions.clux.dev > tests/gen.rs | ||
echo "pub type CR = MultiVersion;" >> tests/gen.rs | ||
kubectl apply -f tests/mv.yaml | ||
cargo test --test runner -- --nocapture | ||
|
||
test-argo: | ||
kubectl apply --force-conflicts --server-side -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/crds/application-crd.yaml | ||
cargo run --bin kopium -- applications.argoproj.io > tests/gen.rs | ||
echo "pub type CR = Application;" >> tests/gen.rs | ||
kubectl apply -f tests/app.yaml | ||
cargo test --test runner -- --nocapture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters