Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Integration Tests

on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
Expand All @@ -13,24 +11,19 @@ on:
jobs:
integration-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6

- name: Build Tower CLI
run: cargo build
- name: Build Tower CLI
run: cargo build

- name: Install Python dependencies
run: uv sync --locked --group dev
- name: Install Python dependencies
run: uv sync --locked --group dev

- name: Run integration tests
run: tests/integration/run_tests.py
- name: Run integration tests
run: tests/integration/run_tests.py --color always
5 changes: 0 additions & 5 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ name: "[tower] Test python"

on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ name: "[tower] Test rust"

on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
14 changes: 6 additions & 8 deletions crates/config/src/towerfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use std::path::PathBuf;

#[derive(Deserialize, Serialize, Debug)]
pub struct Parameter{
pub struct Parameter {
#[serde(default)]
pub name: String,

Expand Down Expand Up @@ -116,7 +116,6 @@ impl Towerfile {
Ok(())
}


/// add_parameter adds a new parameter to the Towerfile
pub fn add_parameter(&mut self, name: String, description: String, default: String) {
self.parameters.push(Parameter {
Expand Down Expand Up @@ -277,20 +276,19 @@ mod test {
fn test_add_parameter() {
let mut towerfile = crate::Towerfile::default();
assert_eq!(towerfile.parameters.len(), 0);

towerfile.add_parameter(
"test-param".to_string(),
"A test parameter".to_string(),
"default-value".to_string()
"default-value".to_string(),
);

assert_eq!(towerfile.parameters.len(), 1);
assert_eq!(towerfile.parameters[0].name, "test-param");
assert_eq!(towerfile.parameters[0].description, "A test parameter");
assert_eq!(towerfile.parameters[0].default, "default-value");
}


#[test]
fn test_roundtrip_serialization() {
let original_toml = r#"[app]
Expand All @@ -310,11 +308,11 @@ name = "param2"
description = "Second parameter"
default = "value2"
"#;

let towerfile = crate::Towerfile::from_toml(original_toml).unwrap();
let serialized = toml::to_string_pretty(&towerfile).unwrap();
let reparsed = crate::Towerfile::from_toml(&serialized).unwrap();

assert_eq!(towerfile.app.name, reparsed.app.name);
assert_eq!(towerfile.app.script, reparsed.app.script);
assert_eq!(towerfile.app.source, reparsed.app.source);
Expand Down
13 changes: 11 additions & 2 deletions crates/tower-cmd/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,17 @@ pub async fn run_app(
},
};

unwrap_api_response(tower_api::apis::default_api::run_app(api_config, params)).await
match tower_api::apis::default_api::run_app(api_config, params).await {
Ok(response) if response.status.is_client_error() || response.status.is_server_error() => {
Err(Error::ResponseError(tower_api::apis::ResponseContent {
tower_trace_id: response.tower_trace_id,
status: response.status,
content: response.content,
entity: None,
}))
}
response => unwrap_api_response(async { response }).await,
}
}

pub async fn export_secrets(
Expand Down Expand Up @@ -719,7 +729,6 @@ impl ResponseEntity for tower_api::apis::default_api::ListEnvironmentsSuccess {
}
}


pub async fn list_environments(
config: &Config,
) -> Result<
Expand Down
4 changes: 1 addition & 3 deletions crates/tower-cmd/src/environments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ pub async fn do_list(config: Config) {
let envs_data: Vec<Vec<String>> = resp
.environments
.into_iter()
.map(|env| {
vec![env.name]
})
.map(|env| vec![env.name])
.collect();

// Display the table using the existing table function
Expand Down
14 changes: 8 additions & 6 deletions crates/tower-cmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ mod apps;
mod deploy;
mod environments;
pub mod error;
mod package;
mod mcp;
pub mod output;
mod package;
mod run;
mod schedules;
mod secrets;
Expand All @@ -16,7 +17,6 @@ mod teams;
mod towerfile_gen;
mod util;
mod version;
mod mcp;

pub use error::Error;

Expand Down Expand Up @@ -165,10 +165,12 @@ impl App {
}
}
}
Some(("mcp-server", args)) => mcp::do_mcp_server(sessionized_config, args).await.unwrap_or_else(|e| {
eprintln!("MCP server error: {}", e);
std::process::exit(1);
}),
Some(("mcp-server", args)) => mcp::do_mcp_server(sessionized_config, args)
.await
.unwrap_or_else(|e| {
eprintln!("MCP server error: {}", e);
std::process::exit(1);
}),
_ => {
cmd_clone.print_help().unwrap();
std::process::exit(2);
Expand Down
Loading
Loading