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

[Enhancement]: modulegen: print output from failed commands #1689

Open
pablochacin opened this issue Sep 26, 2023 · 3 comments
Open

[Enhancement]: modulegen: print output from failed commands #1689

pablochacin opened this issue Sep 26, 2023 · 3 comments
Labels
enhancement New feature or request hacktoberfest Pull Requests accepted for Hacktoberfest.

Comments

@pablochacin
Copy link
Contributor

Proposal

When generating the scaffold for a new module, the modulegen tool executes multiple commands.

In case one of them fails, it is only reported the step that failed, but the actual error is not reported, as seen in the following output:

Error: >> error synchronizing the dependencies: exit status 1

A more detailed output from the tool would facilitate the debugging of errors. For example:

Error: >> error synchronizing the dependencies: exit status 1

go: finding module for package github.com/testcontainers/testcontainers-go/modules/k6
github.com/testcontainers/testcontainers-go/examples/k6 tested by
	github.com/testcontainers/testcontainers-go/examples/k6.test imports
	github.com/testcontainers/testcontainers-go/modules/k6: module github.com/testcontainers/testcontainers-go@latest found (v0.24.1, replaced by ../..), but does not contain package github.com/testcontainers/testcontainers-go/modules/k6

@pablochacin pablochacin added the enhancement New feature or request label Sep 26, 2023
@mdelapenya
Copy link
Member

I think there is a bug in the example template, but it should work if you create a module instead of a example:

In the mean time, instead of creating an example, please try with a real module.

- go run . new example --name k6 --image "grafana/k6" --title k6
+ go run . new module --name k6 --image "grafana/k6" --title k6

@mdelapenya
Copy link
Member

We saw that the docs are a bit misleading, as the first code snippet is for creating an example module (just copy&paste code, no public API) when it should be just the module.

@pablochacin
Copy link
Contributor Author

Hi @mdelapenya thanks for the clarification. I tried that and it worked. 👍

I think it would be worth providing more information about the reason for the failure in the command.

@mdelapenya mdelapenya added the hacktoberfest Pull Requests accepted for Hacktoberfest. label Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Pull Requests accepted for Hacktoberfest.
Projects
None yet
Development

No branches or pull requests

2 participants