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]: replace manual mocks #2765

Open
stevenh opened this issue Sep 2, 2024 · 7 comments
Open

[Enhancement]: replace manual mocks #2765

stevenh opened this issue Sep 2, 2024 · 7 comments
Labels
enhancement New feature or request good first issue Want to contribute to testcontainers? Start from here hacktoberfest Pull Requests accepted for Hacktoberfest.

Comments

@stevenh
Copy link
Collaborator

stevenh commented Sep 2, 2024

Proposal

Replace all manual mocks with generated ones, as started by #2731

@stevenh stevenh added the enhancement New feature or request label Sep 2, 2024
@mdelapenya
Copy link
Member

We must make sure there is a build command to do this 🙏

@stevenh
Copy link
Collaborator Author

stevenh commented Sep 3, 2024

We must make sure there is a build command to do this 🙏

I'd go one step further and ensure we validate they are up to date in CI.

My general preference is to have all of this handled by go generate thoughts?

@mdelapenya
Copy link
Member

sure, the local build must do exactly the same as in the CI, so that developers can replicate what the CI does. So:

  • adding a build command
  • the CI uses a command to validate (simply checking the git state??), that can be used by developers to understand if they missed anything

@stevenh
Copy link
Collaborator Author

stevenh commented Sep 3, 2024

Yer this would be an example of github action to validate:

      - name: Install dependencies
        run: |
          go install github.com/vektra/mockery/[email protected]

      - name: Validate go mod / generate
        run: |
          go generate ./...
          go mod tidy
          git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]

Updating locally would be:

go generate ./...

@mdelapenya
Copy link
Member

Sounds good to me. I'm labelling this as a quick-win

@mdelapenya mdelapenya added hacktoberfest Pull Requests accepted for Hacktoberfest. good first issue Want to contribute to testcontainers? Start from here labels Sep 5, 2024
mdelapenya pushed a commit that referenced this issue Sep 9, 2024
Add generation for mocks, which can be run using make generate or
go generate ./...

Correct output-format for golangci-lint as githubs-actions has been
replaced by colored-line-numbers.

Add pre-commit target to help check code is valid before pushing.

Ensure generate and mod tidy don't result in changes.

Run go mod tidy for all modules, some were out of date.

Implements: #2765
@jasonyunicorn
Copy link

Has anyone stepped up to work on this? If not, I would like to volunteer as a first-time contributor to this repo!

@stevenh
Copy link
Collaborator Author

stevenh commented Nov 30, 2024

Yep I have some work in progress on this but ran into some additional inconsistencies. Need to get some time to split it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Want to contribute to testcontainers? Start from here hacktoberfest Pull Requests accepted for Hacktoberfest.
Projects
None yet
Development

No branches or pull requests

3 participants