Skip to content

Commit

Permalink
Clean up prepended psql error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vrmiguel committed Nov 9, 2023
1 parent 64ef467 commit 31a3e3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 2 additions & 7 deletions cli/src/commands/regress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use super::SubCommand;
type Result<T = ()> = std::result::Result<T, anyhow::Error>;

#[derive(Args)]
pub struct TestCommand {
pub struct RegressCommand {
/// The name of the extension to test
extension_name: String,
/// The psql connection string on which commands will be executed in
Expand All @@ -27,12 +27,7 @@ pub struct TestCommand {

#[derive(Deserialize, Debug)]
struct TrunkProjectInfo {
pub name: String,
pub description: String,
pub documentation_link: String,
pub repository_link: String,
pub version: String,
pub extensions: Vec<Extension>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -125,7 +120,7 @@ async fn extract_sql_and_expected_files(
}

#[async_trait::async_trait]
impl SubCommand for TestCommand {
impl SubCommand for RegressCommand {
async fn execute(&self, _: Task) -> Result<()> {
let tempdir = TempDir::new()?;
// Given an extension name, let's fetch its Trunk project
Expand Down
6 changes: 3 additions & 3 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ enum SubCommands {
Publish(commands::publish::PublishCommand),
/// Install a Postgres extension from the Trunk registry
Install(commands::install::InstallCommand),
/// Test a Postgres extension (coming soon)
Test(commands::test::TestCommand),
/// Test a Postgres extension with its regression tests
Regress(commands::regress::RegressCommand),
}

#[async_trait]
Expand All @@ -45,7 +45,7 @@ impl SubCommand for SubCommands {
SubCommands::Build(cmd) => cmd.execute(task).await,
SubCommands::Publish(cmd) => cmd.execute(task).await,
SubCommands::Install(cmd) => cmd.execute(task).await,
SubCommands::Test(cmd) => cmd.execute(task).await,
SubCommands::Regress(cmd) => cmd.execute(task).await,
}
}
}
Expand Down

0 comments on commit 31a3e3f

Please sign in to comment.