Skip to content

Commit

Permalink
fix(config): fix test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
indirection42 committed Apr 24, 2024
1 parent d613669 commit bf9a7bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
- name: Run tests
run: cargo test --verbose
- name: Run validate
run: cargo run --validate
run: cargo run -- validate
8 changes: 8 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub struct MiddlewaresConfig {
pub struct Config {
#[garde(dive)]
pub extensions: ExtensionsConfig,
// TODO: #[garde(custom(has_matched_extensions(&self.extensions)))]
pub middlewares: MiddlewaresConfig,
#[garde(dive)]
pub rpcs: RpcDefinitions,
Expand Down Expand Up @@ -278,6 +279,13 @@ mod tests {
let _config = read_config("configs/config_with_env.yml").unwrap();
}

#[tokio::test]
async fn validate_basic_config_should_work() {
let config = read_config("configs/config.yml").expect("Unable to read config file");
let result = validate(&config).await;
assert!(result.is_ok());
}

#[tokio::test]
async fn validate_broken_endpoints_should_fail() {
let config = read_config("configs/broken_endpoints.yml").expect("Unable to read config file");
Expand Down

0 comments on commit bf9a7bf

Please sign in to comment.