Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add full integration test for tuono new CLI command #411

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Robert-maker1994
Copy link
Contributor

@Robert-maker1994 Robert-maker1994 commented Jan 24, 2025

Close #405

@github-actions github-actions bot added the rust Requires rust knowledge label Jan 24, 2025
@marcalexiei marcalexiei changed the title Add full integration test for tuono new CLI command (#405) test: add full integration test for tuono new CLI command Jan 24, 2025
Copy link
Member

@marcalexiei marcalexiei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Robert-maker1994 there are conflicts into your branch.
Could you please resolve them? Unless you do CI won't run.

crates/tuono/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@Valerioageno Valerioageno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of considerations. I'm available for discussing them

crates/tuono/src/externalUrl.rs Outdated Show resolved Hide resolved
crates/tuono/tests/cli_new.rs Outdated Show resolved Hide resolved
crates/tuono/.env Outdated Show resolved Hide resolved
crates/tuono/.env.test Outdated Show resolved Hide resolved
use tuono::cli::app;

fn main() {
dotenvy::dotenv().ok();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things here:

  1. I'd put everything within app for better future integration tests
  2. I'd use dotenvy_macro to load the env at compile time (otherwise the published build will ask for it to the users)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to implement the dotenvy_macro and I found a problem as the dotenvy_macro doesn't recognise the .env file. There seems to be a few open issues to do with this macro!
issue with the env path
Compile-time macro should be configurable with path - With the macro not being able to load with .env.

I am a little stuck on what to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository seems updated with the fix.
We could trying loading the dependency using a fixed git commit with a commit to remember to load it from crates as soon as they release. WDYT? Seems a very little module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, seems a very little module and the main contributor says this is coming in v0.16. I've added the repository, I've moved initializing dotenv::load untill the cli app function.

crates/tuono/src/scaffold_project.rs Outdated Show resolved Hide resolved
crates/tuono/src/scaffold_project.rs Outdated Show resolved Hide resolved
crates/tuono/tests/cli_new.rs Show resolved Hide resolved
@marcalexiei
Copy link
Member

There was an issue with "PR title checker" workflow.
When you have the change, could you please merge main branch?

Apologies for the inconvenience 😰

crates/tuono/.env Outdated Show resolved Hide resolved
crates/tuono/.env.test Outdated Show resolved Hide resolved
@@ -31,8 +31,10 @@ serde_json = "1.0"
fs_extra = "1.3.0"
http = "1.1.0"
tuono_internal = {path = "../tuono_internal", version = "0.17.5"}
dotenvy = { git = "https://github.com/allan2/dotenvy", features = ["macros"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix it with a commit so that we "kinda" prevent regression on the main branch. Do you know when the 0.16 will be released? I think that if it is not too far away we can wait it to merge this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for a response from the main maintainer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can give it a day or so then decide what to do if he responds or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks for running the extra mile! In case that is not possible, we can try to figure out another configuration system different from .env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Requires rust knowledge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add full integration test for tuono new CLI command
3 participants