Skip to content

feat: validacao com testcontainers, build docker no ci e retencao de pacotes - #12

Merged
elielsousa-pathbit merged 2 commits into
masterfrom
feat/testcontainers-ci-packages
Sep 18, 2026
Merged

elielsousa-pathbit merged 2 commits into
masterfrom
feat/testcontainers-ci-packages

Conversation

@elielsousa-pathbit

Copy link
Copy Markdown
Contributor

Implementa a validacao da imagem Docker utilizando Testcontainers, adiciona a verificacao do build no GitHub Actions CI e garante a retencao das ultimas 3 versoes no GitHub Packages.

Comment thread tests/test_container.py Fixed
@elielsousa-pathbit
elielsousa-pathbit merged commit 70cc4c2 into master Sep 18, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd5eb469de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_container.py
Comment on lines +52 to +56
try:
import testcontainers
import docker
except ImportError:
raise unittest.SkipTest("testcontainers ou docker não estão instalados")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Install container-test dependencies before gating releases

When .github/workflows/release.yml discovers this new test, neither testcontainers nor docker has been installed—the workflow only runs plain pip install . after the test step—so this branch skips the entire class and the dependent job can publish a tagged or manually dispatched image without exercising its runtime validation. Install the test extras before the release test step or otherwise make the container-validation job a prerequisite of publishing.

Useful? React with 👍 / 👎.

Comment thread tests/test_container.py
Comment on lines +62 to +65
try:
cls.imagem = obter_ou_construir_imagem(cls.imagem)
except Exception as e:
raise unittest.SkipTest(f"Falha ao obter ou construir imagem Docker: {e}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fail when obtaining or building the image fails

When the requested image is absent and its Dockerfile build fails, this catches the build exception and converts it into SkipTest, so a direct invocation of the new Testcontainers suite exits successfully instead of detecting the broken image. Only unavailable optional infrastructure should be skipped; failures from obter_ou_construir_imagem should propagate as test failures.

Useful? React with 👍 / 👎.

Comment on lines +113 to +116
prune-packages:
name: Prune Older Packages (Keep Last 3)
needs: build-and-push-docker
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep package cleanup out of the release success path

Every completed release already triggers the retention action in .github/workflows/cleanup-packages.yml, so this job performs the same destructive cleanup a second time. More importantly, a transient GHCR/API failure here now marks an otherwise successfully built and pushed release as failed; the existing cleanup workflow then skips its own retention job because it requires the release conclusion to be success. Remove this duplicate job and leave retention to the separately serialized workflow.

Useful? React with 👍 / 👎.

@elielsousa-pathbit
elielsousa-pathbit deleted the feat/testcontainers-ci-packages branch September 18, 2026 12: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.

1 participant