Back to the course
Test yourself

Terratest

Final exam · 12 questions · answers explained as you pick
Beginner
4 questions
01Terratest tests infrastructure by…
Incorrect — that is Checkov; Terratest actually deploys.
Correct — integration testing: deploy → validate → destroy.
Incorrect — no — it exercises the real thing.
Incorrect — no.
02Terratest is written in / used from…
Incorrect — no.
Incorrect — no — it is a Go library.
Correct — run with go test.
Incorrect — no.
03The universal cleanup idiom is…
Correct — Go defers run on return/panic — guarantees cleanup.
Incorrect — does not clean up.
Incorrect — leaks real resources.
Incorrect — never.
04You must set a long -timeout because…
Incorrect — not the reason.
Correct — size the timeout to slowest deploy + teardown.
Incorrect — no.
Incorrect — no.
4 questions · explanations appear as you answer
Intermediate
4 questions
01Terratest handles eventual consistency with…
Incorrect — that flakes — reality has not caught up.
Incorrect — slow and still flaky.
Correct — fast when ready, clear error when genuinely broken.
Incorrect — no.
02For Kubernetes/Helm tests, an inexpensive isolated cluster is often…
Correct — a full cluster in a container — no cloud bill, total isolation.
Incorrect — never.
Incorrect — tests collide; at least namespace per run.
Incorrect — you need one to deploy.
03test_structure stages let you…
Incorrect — no — they stage deploy/validate/teardown.
Correct — turns a 5-min cycle into seconds during development.
Incorrect — no.
Incorrect — no.
04To run Terratest tests in parallel safely you must first…
Correct — shared names/dirs/state collide — isolation before t.Parallel().
Incorrect — no.
Incorrect — that clobbers .terraform/state.
Incorrect — unrelated and harmful.
4 questions · explanations appear as you answer
Advanced
4 questions
01In the infra testing pyramid, Terratest belongs…
Incorrect — no — it is slow and costly.
Correct — push cheap checks (validate, Checkov, plan) to the base.
Incorrect — it has a clear role.
Incorrect — it complements them.
02The single most important safety control for Terratest is…
Correct — isolation contains any mistake or leak to a disposable environment.
Incorrect — the opposite — keep it cheap.
Incorrect — that causes leaks.
Incorrect — never.
03Beyond defer-destroy, CI needs a scheduled sweep (e.g. cloud-nuke) because…
Incorrect — no.
Incorrect — no.
Correct — tag + sweep as a backstop; assume cleanup is sometimes skipped.
Incorrect — it usually does — the sweep covers the exceptions.
04Relative to static scanning, Terratest…
Incorrect — no — they answer different questions.
Correct — build the whole pyramid; each layer does what it is best at.
Incorrect — far more expensive.
Incorrect — it deploys — it needs (sandbox) credentials.
4 questions · explanations appear as you answer