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

ci: Add test for Terraform dependabot config #155

Merged
merged 2 commits into from
May 31, 2024
Merged

Conversation

zkoppert
Copy link
Member

@zkoppert zkoppert commented May 31, 2024

Pull Request

Proposed Changes

fixes #152

This pull request introduces a new test case to ensure the correct generation of dependabot configuration files for Terraform projects within the test_dependabot_file.py file.

  • Adds a new test case: Implements test_build_dependabot_file_with_terraform to verify that dependabot configuration files correctly include Terraform as a package ecosystem when Terraform files are present in the repository.
  • Handles absence of Terraform files and no files at all: Enhances the test to also verify that no Terraform entry is added to the dependabot configuration file when no Terraform files are present in the repository.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance or breaking

@zkoppert
Copy link
Member Author

My primary question for reviewers here is what do you think about the multiple assertions in one test? Should I split out into multiple test or leave all 3 scenarios (.tf file present, no .tf file present, no files present) in the one terraform test?

@zkoppert zkoppert mentioned this pull request May 31, 2024
Copy link
Member

@jmeridth jmeridth left a comment

Choose a reason for hiding this comment

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

@jmeridth
Copy link
Member

My primary question for reviewers here is what do you think about the multiple assertions in one test? Should I split out into multiple test or leave all 3 scenarios (.tf file present, no .tf file present, no files present) in the one terraform test?

I tend to prefer split out but not a hill to die on IMO. 😄 Your call.

@zkoppert zkoppert enabled auto-merge May 31, 2024 17:38
@zkoppert zkoppert merged commit f4d83c1 into main May 31, 2024
23 checks passed
@zkoppert zkoppert deleted the terraform-tests branch May 31, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform dependabot files need a test written
2 participants