Skip to content

Commit

Permalink
Add tests for cluster components
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Nov 13, 2023
1 parent 2001434 commit c230bb6
Show file tree
Hide file tree
Showing 22 changed files with 1,995 additions and 646 deletions.
232 changes: 145 additions & 87 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ tempfile = { version = "3.8" }
test-case = "3.1"
testcontainers = { version = "0.14", features = ["watchdog"] }
bytes = "1"
mockito = "1"

[features]
default = ["integration"]
Expand Down
2 changes: 1 addition & 1 deletion k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Experimental, for testing, don't use in production or if you do fix all the thin

Based on https://kubernetes.io/docs/tutorials/stateful-application/cassandra/

this are purely notes
These are purely notes

```
minikube start --cpus 16 --memory 8192 --disk-size 50000mb
Expand Down
2 changes: 1 addition & 1 deletion packaging/cross_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ echo "Successfully built the binary: ${TARGET_BIN}"
# linking check
echo "Printing linking information for the binary..."
file "$TARGET_BIN"
ldd "$TARGET_BIN" || true
ldd "$TARGET_BIN"

# back to the origin dir, just in case
popd > /dev/null
10 changes: 5 additions & 5 deletions src/connectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub(crate) trait Context: Display + Clone {
fn connector_type(&self) -> &ConnectorType;

/// gets the API sender
fn raft(&self) -> &raft::ClusterInterface;
fn raft(&self) -> Option<&raft::Cluster>;

/// the application context
fn app_ctx(&self) -> &AppContext;
Expand Down Expand Up @@ -389,8 +389,8 @@ impl Context for ConnectorContext {
&self.notifier
}

fn raft(&self) -> &raft::ClusterInterface {
&self.app_ctx.raft
fn raft(&self) -> Option<&raft::Cluster> {
self.app_ctx.raft.as_ref()
}

Check warning on line 394 in src/connectors.rs

View check run for this annotation

Codecov / codecov/patch

src/connectors.rs#L392-L394

Added lines #L392 - L394 were not covered by tests

fn app_ctx(&self) -> &AppContext {
Expand Down Expand Up @@ -1342,8 +1342,8 @@ pub(crate) mod unit_tests {
fn connector_type(&self) -> &ConnectorType {
&self.t
}
fn raft(&self) -> &raft::ClusterInterface {
&self.app_ctx.raft
fn raft(&self) -> Option<&raft::Cluster> {
self.app_ctx.raft.as_ref()
}
fn app_ctx(&self) -> &AppContext {
&self.app_ctx
Expand Down
Loading

0 comments on commit c230bb6

Please sign in to comment.