• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TEN-framework / ten-framework / 20852364218

09 Jan 2026 12:46PM UTC coverage: 57.74% (-0.01%) from 57.752%
20852364218

push

github

web-flow
feat: support tman check interface subcommand (#1971)

11 of 38 new or added lines in 2 files covered. (28.95%)

4 existing lines in 1 file now uncovered.

54447 of 94297 relevant lines covered (57.74%)

708028.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.04
/core/src/ten_manager/src/cmd/cmd_check/cmd_check_interface_json.rs
1
//
2
// Copyright © 2025 Agora
3
// This file is part of TEN Framework, an open source project.
4
// Licensed under the Apache License, Version 2.0, with certain conditions.
5
// Refer to the "LICENSE" file in the root directory for more information.
6
//
7
use std::sync::Arc;
8

9
use anyhow::Result;
10
use clap::{Arg, ArgMatches, Command};
11
use console::Emoji;
12
use ten_rust::json_schema::ten_validate_interface_json_file;
13

14
use crate::{
15
    designer::storage::in_memory::TmanStorageInMemory, home::config::TmanConfig, output::TmanOutput,
16
};
17

18
#[derive(Debug)]
19
pub struct CheckInterfaceJsonCommand {
20
    pub path: String,
21
}
22

23
pub fn create_sub_cmd(_args_cfg: &crate::cmd_line::ArgsCfg) -> Command {
194✔
24
    Command::new("interface")
194✔
25
        .about("Check if an interface JSON file is valid according to the json schema")
194✔
26
        .arg(
194✔
27
            Arg::new("PATH")
194✔
28
                .long("path")
194✔
29
                .help("The file path of interface JSON file to be checked")
194✔
30
                .required(true)
194✔
31
                .num_args(1),
194✔
32
        )
33
}
194✔
34

NEW
35
pub fn parse_sub_cmd(sub_cmd_args: &ArgMatches) -> Result<CheckInterfaceJsonCommand> {
×
NEW
36
    let cmd = CheckInterfaceJsonCommand {
×
NEW
37
        path: sub_cmd_args.get_one::<String>("PATH").cloned().unwrap(),
×
NEW
38
    };
×
39

NEW
40
    Ok(cmd)
×
NEW
41
}
×
42

NEW
43
pub async fn execute_cmd(
×
NEW
44
    _tman_config: Arc<tokio::sync::RwLock<TmanConfig>>,
×
NEW
45
    _tman_storage_in_memory: Arc<tokio::sync::RwLock<TmanStorageInMemory>>,
×
NEW
46
    command_data: CheckInterfaceJsonCommand,
×
NEW
47
    out: Arc<Box<dyn TmanOutput>>,
×
NEW
48
) -> Result<()> {
×
NEW
49
    match ten_validate_interface_json_file(&command_data.path) {
×
50
        Ok(_) => {
NEW
51
            out.normal_line(&format!("{}  Conforms to JSON schema.", Emoji("👍", "Passed")));
×
NEW
52
            Ok(())
×
53
        }
NEW
54
        Err(e) => Err(e),
×
55
    }
NEW
56
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc