Skip to content

tests(refactor): Amavis spam_junk_folder.bats + spam_bounced.bats#3036

Merged
polarathene merged 6 commits intodocker-mailserver:masterfrom
polarathene:tests/refactor-amavis-junk-bounce
Jan 29, 2023
Merged

tests(refactor): Amavis spam_junk_folder.bats + spam_bounced.bats#3036
polarathene merged 6 commits intodocker-mailserver:masterfrom
polarathene:tests/refactor-amavis-junk-bounce

Conversation

@polarathene
Copy link
Copy Markdown
Member

Description

Extracted from #3033

  • These two tests would fail if Postfix was ready, but Amavis had not finished initializing. Which is what happens with the referenced PR.
  • Both tests are from the same original PR that introduced two ENV to be tested. Merged the files into a single test file.
  • Refactored the tests to share common test methods.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change that does improve existing functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

Postfix can potentially be ready before Amavis is. This caused test failures as mail was sent before Amavis was ready to process it.

Both test cases shared the same test logic, except for the expected location to deliver the spam to. Extracted into a shared test method, and moved the port conditions into there.
Test case descriptions, container names and test prefix are now more descriptive of what is under test here (an ENV for Amavis).
These two tests seem to be related to the same feature. Grouping them into a single test file instead.
Now it can be better shared with the bounce test case.
No changes to code, just cut + paste of the `CONTAINER3_NAME` test case to shift it to the last test case position.
@polarathene

This comment was marked as outdated.

@polarathene polarathene enabled auto-merge (squash) January 29, 2023 12:29
@polarathene polarathene merged commit ed63a6f into docker-mailserver:master Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tests kind/improvement Improve an existing feature, configuration file or the documentation service/security/amavis

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants