Skip to content

refactor(ci): Centralize Docker configuration testing using matrix strategy #9388

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

gustavovalverde
Copy link
Member

@gustavovalverde gustavovalverde commented Apr 7, 2025

Motivation

This PR addresses the need for Docker configuration testing identified in issue #9037. Our current testing approach for Docker configurations has several limitations:

  1. Scattered Test Logic: Tests are duplicated across CI and CD pipelines, making maintenance difficult
  2. Limited Coverage: Only a few basic configuration scenarios are tested
  3. Scalability Issues: Adding new test scenarios requires changes in multiple files
  4. Inconsistent Testing: CI and CD environments may diverge in their testing coverage
  5. Difficult Integration Testing: Testing interactions with third-party applications is challenging

Depends-On: #9344
Closes: #9037

Solution

This PR implements a centralized, matrix-based approach to Docker configuration testing:

  1. Architectural Decision Record (ADR): Created a new ADR documenting the rationale for centralizing Docker tests
  2. Matrix Strategy: Converted multiple separate test jobs into a single comprehensive matrix-based test
  3. Consolidated Test Scenarios: Moved all test scenarios from both CI and CD pipelines into a single reusable workflow
  4. Expanded Test Coverage: Defined an extensive test matrix covering:
    • Network configurations (Mainnet/Testnet)
    • RPC server configurations (ports, listen addresses)
    • Directory and permission testing
    • Feature-specific configurations (Prometheus, tracing)
    • Mining configurations
    • Config precedence and generation testing
  5. Simplified Workflow Interface: Reduced required inputs to just the Docker image identifier

This centralized approach makes it easier to add new test scenarios, including those that validate third-party integrations.

Tests

The solution is self-testing (validation of the test outputs must be done)

Specifications & References

Follow-up Work

Future enhancements to consider:

  • Add more complex integration tests with lightwalletd and other third-party applications
  • Implement Docker Bake for local testing of complex build configurations
  • Create testing scenarios for volume mounts and persistent data

PR Checklist

  • The PR name is suitable for the release notes.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.
  • If the PR shouldn't be in the release notes, it has the C-exclude-from-changelog label.

@gustavovalverde gustavovalverde requested review from a team as code owners April 7, 2025 13:56
@gustavovalverde gustavovalverde requested review from conradoplg and removed request for a team April 7, 2025 13:56
@github-actions github-actions bot added the C-feature Category: New features label Apr 7, 2025
@gustavovalverde gustavovalverde marked this pull request as draft April 7, 2025 13:56
Copy link
Contributor

mergify bot commented Apr 7, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

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

This is amazing.

@upbqdn upbqdn merged commit 852c4f5 into refactor-conf Apr 11, 2025
164 of 165 checks passed
@upbqdn upbqdn deleted the feat-docker-tests branch April 11, 2025 11:51
@gustavovalverde gustavovalverde restored the feat-docker-tests branch April 14, 2025 10:25
Copy link
Contributor

mergify bot commented Apr 14, 2025

⚠️ The sha of the head commit of this PR conflicts with #9423. Mergify cannot evaluate rules on this PR. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

devops: add more unit-tests for our docker and docker-compose
2 participants