Skip to content

Commit

Permalink
Build CLI: User config integration tests & Name alias
Browse files Browse the repository at this point in the history
* Add test for user configuration commands
* Change command naming alias
  • Loading branch information
AmmarAbouZor committed Oct 23, 2024
1 parent b662bc4 commit 9e470c3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cli/integration_tests/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from test_cmd import run_test_command
from release import run_release_command
from bench import run_benchmark_command
from user_config import run_user_configs_commands


def run_all():
Expand Down Expand Up @@ -84,6 +85,14 @@ def run_all():
raise
print_separator()

### User Configurations ###
try:
run_user_configs_commands()
except Exception:
print_err("User Configurations")
raise
print_separator()

### Shell Completion ###
try:
run_shell_completion_commands()
Expand Down
33 changes: 33 additions & 0 deletions cli/integration_tests/user_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Provides methods to test the User Configurations commands in Chipmunk Build CLI Tool
"""

from utls import run_command, print_blue_bold, print_green_bold

CONFIG_BASE_COMMAND = [
"cargo",
"run",
"-r",
"--",
"chipmunk",
"config",
]


def run_user_configs_commands():
"""Runs commands to print the default configurations and the path for the configurations file"""
print_blue_bold("Running print configurations file path Command...")
print_path_cmd = CONFIG_BASE_COMMAND.copy()
print_path_cmd.append("path")
run_command(print_path_cmd)
print_green_bold("*** Print configurations file path Command Succeeded ***")

print_blue_bold("Running print default configurations Command...")
print_default_cmd = CONFIG_BASE_COMMAND.copy()
print_default_cmd.append("default")
run_command(print_default_cmd)
print_green_bold("*** Print default configurations Command Succeeded ***")


if __name__ == "__main__":
run_user_configs_commands()
2 changes: 1 addition & 1 deletion cli/src/cli_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub enum UserConfigCommand {
#[clap(visible_alias = "path")]
/// Prints the path to the user configurations file.
PrintPath,
#[clap(name = "print-default", visible_alias = "dump")]
#[clap(name = "print-default", visible_alias = "default")]
/// Dumps the configurations with the default values to be used as a reference and base to
/// user configurations.
DumpDefaultConfiguration,
Expand Down

0 comments on commit 9e470c3

Please sign in to comment.