Skip to content

Commit

Permalink
Merge pull request #16 from lexara-prime-ai/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
irfanghat authored Jul 11, 2024
2 parents 5e861c6 + 3f58aae commit 7754bac
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
- name: Code Coverage Summary
uses: irongut/[email protected]
uses: irongut/[email protected]

'on':
push:
branches: [ "master" ]
tags: '*'
2 changes: 1 addition & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "render_cdk"
version = "0.0.3"
version = "0.0.4"
edition = "2021"
authors = ["Irfan Ghat"]
description = "This crate provides a streamlined interface for interacting with Render, a platform that allows you to build, deploy, and scale your apps with ease."
Expand Down
2 changes: 1 addition & 1 deletion rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add `render_cdk` to your `Cargo.toml`:

```toml
[dependencies]
render_cdk = "0.0.1"
render_cdk = "0.0.4"
```

### Usage
Expand Down
23 changes: 20 additions & 3 deletions rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ use tokio::main;
/// Examples
#[main]
async fn main() {
/// Examples
/// 1. Querying for deployed Services.
///
/// List all Services.
let services = ServiceManager::list_all_services("20").await;

// List all Services by Name and Type.
/// List all Services by Name and Type.
let services = ServiceManager::find_service_by_name_and_type("whoami", "web_service").await;

// List all Services by Region.
/// List all Services by Region.
let services = ServiceManager::find_service_by_region("oregon", "10").await;

// List all Services by Environment.
/// List all Services by Environment.
let services = ServiceManager::find_service_by_environment("image", "10").await;
////////////////////////////////////////////////
}

/// Checks for regression of service management functions
Expand Down Expand Up @@ -48,6 +52,7 @@ async fn main() {
/// let services = result.unwrap();
/// assert!(!services.is_empty());
/// }
///
/// More tests...
#[cfg(test)]
Expand Down Expand Up @@ -86,4 +91,16 @@ mod tests {
let services = result.unwrap();
assert!(!services.is_empty());
}

#[tokio::test]
async fn test_find_service_by_environment() {
let result = ServiceManager::find_service_by_environment("image", "10").await;

// The reult should be Ok().
assert!(result.is_ok());

// Validate data.
let services = result.unwrap();
assert!(!services.is_empty());
}
}

0 comments on commit 7754bac

Please sign in to comment.