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

Run acceptance tests only when 'acceptance' go:build tag is present #21

Merged
merged 1 commit into from
May 8, 2024

Conversation

bogdanguranda
Copy link
Contributor

@bogdanguranda bogdanguranda commented May 8, 2024

Description

This solves the problem of running acceptance tests as per the solution agreed (running them only manually from local).

It's using //go:build acceptance go build tag to mark acceptance test files (and //go:build unit). File naming convention I used is: *_acc_test.go for acceptance tests file, and *_test.go for unit tests file.

This can easily be tested locally with go test ./... (without the tag) or go test ./... -tags=acceptance, if one wants to run the acceptance tests too from local.

I also did some file renaming and class renaming, as per terraform conventions used in other cisco-open repos.

This also copied over all the changes present in this PR (so it can be closed now): #16

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@bogdanguranda bogdanguranda marked this pull request as draft May 8, 2024 13:52
@bogdanguranda bogdanguranda marked this pull request as ready for review May 8, 2024 14:08
@DodinViorel
Copy link
Contributor

Looks good to me. In the future when we will have a solution for the acc tests we just need to add the github action for the new makefile target.

Copy link
Contributor

@kprav33n kprav33n left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@bogdanguranda
Copy link
Contributor Author

@kprav33n I just re-did the commits, because I didn't have a signing key for my commits.

@bogdanguranda bogdanguranda merged commit e3685a7 into cisco-open:main May 8, 2024
5 checks passed
@bogdanguranda bogdanguranda deleted the tests_and_docs branch May 8, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants