Skip to content

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

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 23bedb3 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: 8cab572262

ℹ️ 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 on lines +113 to +115
prune-packages:
name: Prune Older Packages (Keep Last 3)
needs: build-and-push-docker

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 pruning out of the release workflow

Remove this duplicate retention job: .github/workflows/cleanup-packages.yml already listens for completion of Release and Docker Package and runs the same cleanup action with the same policy. Every successful release therefore performs deletion and registry validation twice, while a transient failure in this new job marks an otherwise successfully published release workflow as failed; if it fails, the existing retention workflow then skips its cleanup because it requires a successful release conclusion.

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 the test when image construction fails

When Docker is available but the requested image is absent, this helper attempts to build the Dockerfile; however, any build error is converted into SkipTest, so a local or standalone run of the new container suite reports success-with-skip for exactly the broken Dockerfile it is intended to validate. Only dependency or daemon unavailability should skip the suite—once docker_disponivel() has succeeded, failures from obter_ou_construir_imagem() should fail the test.

Useful? React with 👍 / 👎.

Comment thread tests/test_container.py
Comment on lines +111 to +115
# Sem banco montado e sem gateway externo, o healthz esperado é 503 DATABASE_NOT_READY
self.assertIn(status_healthz, (200, 503))
self.assertEqual(cabecalho_server, "9RTKSync")
self.assertTrue(
"OK" in corpo_healthz or "DATABASE_NOT_READY" in corpo_healthz or "ROUTER_SERVICE_UNREACHABLE" in corpo_healthz,

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 Assert the deterministic default health response

The container started here has neither /app/data/db/data.sqlite nor a gateway running at its container-local 127.0.0.1, so, as the preceding comment states, the expected result is specifically 503 DATABASE_NOT_READY. Accepting 200 OK or ROUTER_SERVICE_UNREACHABLE allows regressions in the default DB_PATH wiring or database-readiness check to pass this image validation even though the container is reporting the wrong state.

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