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

Add integration tests for Docker images #373

Open
MaxymVlasov opened this issue Apr 20, 2022 · 0 comments
Open

Add integration tests for Docker images #373

MaxymVlasov opened this issue Apr 20, 2022 · 0 comments
Labels
estimate/2days Need 2 work days to be done good first issue Good for newcomers

Comments

@MaxymVlasov
Copy link
Collaborator

MaxymVlasov commented Apr 20, 2022

What problem are you facing?

At the start of April 2022 git released a new non-major version that includes a new check, that fails pre-commit-terraform runtime (#370)
I'd like to not pin minor and patch versions of deps to avoid extra maintenance and security issues. At the same time, something can happen with deps, and we got a runtime error. So, we need to run runtime tests.

How I see the realization of integration tests:

  1. That should be a part of build-image-test.yaml pipeline.
  2. Need to add steps that go inside the build image and do the next things:
    2.1. git clone repo with pre-commit-terraform test cases (subdir in tests/, in future, can be moved to separate repo)
    2.2. Prepare to run pre-commit: cd pre-commit-terraform/tests, rm -rf ../.git, git init, git add -A
    2.3. For each hook: Run pre-commit run -a HOOK_NAME and check that the output result is the same as expected.
    I suppose that it can be done via bats-core (check Add unit-tests that will found problems with new code #303 for additional info)

So, from text above, we need to:

  1. Add terraform code (valid and not) that we will test
  2. Add tests, that will check that pre-commit run -a HOOK_NAME output is OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate/2days Need 2 work days to be done good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant