Merge pull request #171 from code0-tech/#96-reader-verification-tests · code0-tech/code0-flow@c611d87 · GitHub
Skip to content

Commit c611d87

Browse files
Merge pull request #171 from code0-tech/#96-reader-verification-tests
reader verification tests
2 parents 6df9a67 + 47d2cbd commit c611d87

7 files changed

Lines changed: 332 additions & 32 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 42 additions & 12 deletions

‎.github/workflows/publish.yml‎

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ on:
55
tags:
66
- '*'
77

8+
permissions:
9+
contents: read
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
RUST_BACKTRACE: full
14+
815
jobs:
9-
crates:
16+
publish:
1017
runs-on: ubuntu-latest
1118

1219
environment: packages
@@ -16,21 +23,36 @@ jobs:
1623
shell: bash
1724

1825
steps:
19-
# Set up
2026
- uses: actions/checkout@v7
27+
2128
- name: Setup rust
22-
run: rustup update --no-self-update stable
29+
run: |
30+
rustup update --no-self-update stable
31+
rustup component add rustfmt clippy
32+
2333
- name: Install protoc
24-
run: curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.0-rc1/protoc-28.0-rc-1-linux-x86_64.zip && unzip protoc-28.0-rc-1-linux-x86_64.zip -d ${{ runner.temp }}/proto && chmod +x ${{ runner.temp }}/proto/bin/protoc && ${{ runner.temp }}/proto/bin/protoc --version
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y protobuf-compiler
37+
protoc --version
38+
2539
- name: Set version
2640
run: sed -i "s/version = \"0.0.0\"/version = \"${{ github.ref_name }}\"/" Cargo.toml
41+
42+
- name: Check formatting
43+
run: cargo fmt --all -- --check
44+
45+
- name: Check crate
46+
run: cargo check --locked --all-targets --features all
47+
48+
- name: Run clippy
49+
run: cargo clippy --locked --all-targets --features all -- -D warnings
50+
51+
- name: Run tests
52+
run: cargo test --locked --features all
53+
2754
- name: Cargo Login
2855
run: cargo login ${{secrets.CARGO_REGISTRY_TOKEN}}
29-
- name: Build crate
30-
run: PATH=${{ runner.temp }}/proto/bin:$PATH cargo build
31-
env:
32-
RUST_BACKTRACE: 'full'
3356

34-
# Release
3557
- name: Publish crate
36-
run: cargo publish --allow-dirty
58+
run: cargo publish --allow-dirty

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Internal Rust library for CodeZero execution services (Aquila, Draco, Taurus). I
1111
- `flow_service` push definitions to Aquila via gRPC (depends on `flow_definition`)
1212
- `flow_config` env helpers and `.env` loading
1313
- `flow_health` tonic health service with NATS readiness
14-
14+
- `flow_telemetry` helpers for Open Telemetry

‎src/flow_config/mod.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ pub fn env_with_default<T: FromStr + Debug>(key: &str, default: T) -> T {
77
match std::env::var(key) {
88
Ok(string) => match T::from_str(&string) {
99
Ok(value) => {
10-
log::info!("Found env: {} with value: {:?}", key, &value);
10+
log::info!("Found env: {} with value: {:?}", key, value);
1111
value
1212
}
1313
Err(_) => {
14-
log::warn!("Failed to parse env: {} with value: {:?}", key, &string);
14+
log::warn!("Failed to parse env: {} with value: {:?}", key, string);
1515
default
1616
}
1717
},
@@ -99,7 +99,7 @@ mod tests {
9999
}
100100

101101
let result = env_with_default(key, false);
102-
assert_eq!(result, true);
102+
assert!(result);
103103

104104
unsafe {
105105
env::remove_var(key);
@@ -114,7 +114,7 @@ mod tests {
114114
}
115115

116116
let result = env_with_default(key, true);
117-
assert_eq!(result, false);
117+
assert!(!result);
118118

119119
unsafe {
120120
env::remove_var(key);
@@ -141,7 +141,7 @@ mod tests {
141141
}
142142

143143
let result = env_with_default(key, false);
144-
assert_eq!(result, false);
144+
assert!(!result);
145145

146146
unsafe {
147147
env::remove_var(key);

‎src/flow_definition/error/mod.rs‎

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)