Skip to content

[#3230] Cleared inherited 'CLAMAV_' variables in the settings tests. - #3231

Merged
AlexSkrypnyk merged 2 commits into
mainfrom
feature/3230-clamav-env-vars
Oct 22, 2026
Merged

AlexSkrypnyk merged 2 commits into
mainfrom
feature/3230-clamav-env-vars

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Closes #3230

Summary

SettingsTestCase::setEnvVars() now unsets inherited CLAMAV_* environment variables before each settings test, because 'CLAMAV_' is in SettingsTestCase::ALLOWED_ENV_VARS alongside 'REDIS_'.

settings.clamav.php reads CLAMAV_HOST and CLAMAV_PORT with clamav and 3310 as fallbacks, but the prefix list never cleared them. When either variable was exported in the shell or CI job that ran PHPUnit, the daemon mode with defaults case in SwitchableSettingsTest::dataProviderClamav() read that value instead of the default it asserts, and failed on mode_daemon_tcpip.hostname.

The ClamAV cases now pass regardless of what the caller's environment holds, and cases that set CLAMAV_HOST / CLAMAV_PORT explicitly still get their values. settings.clamav.php and the test data providers are untouched; the installer fixtures that carry their own copy of SettingsTestCase.php (baseline, the migration variants and the Acquia hosting variants) are regenerated to match.

Before / After

BEFORE                                    AFTER
CLAMAV_HOST=custom_host (exported)        CLAMAV_HOST=custom_host (exported)
        |                                         |
        v                                         v
setEnvVars(): prefix not listed,          setEnvVars(): 'CLAMAV_' listed,
CLAMAV_HOST survives                      CLAMAV_HOST unset
        |                                         |
        v                                         v
settings.clamav.php -> 'custom_host'      settings.clamav.php -> 'clamav'
        |                                         |
        v                                         v
"daemon mode with defaults": FAIL         "daemon mode with defaults": PASS

Changes

  • tests/phpunit/Drupal/SettingsTestCase.php - added 'CLAMAV_' to ALLOWED_ENV_VARS under the service variables.
  • .vortex/installer/tests/Fixtures/handler_process/*/tests/phpunit/Drupal/SettingsTestCase.php - regenerated snapshots for _baseline, the migration_* scenarios, tools_no_dclint_migration and the 2 Acquia hosting scenarios (the Acquia diffs only shift their hunk line numbers by 1).

Summary by CodeRabbit

  • Tests
    • Test configurations now accept environment variables with the ClamAV prefix. This broadens which environment settings can be used during automated tests. There are no changes to application behavior or functionality visible to end users.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 344d8aeb-1e0d-493e-9d0b-b72f272209a0
📥 Commits

Reviewing files that changed from the base of the PR and between 807fc1e and 6d3f9e7.

⛔ Files ignored due to path filters: 13
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_migration/tests/phpunit/Drupal/SettingsTestCase.php is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing: 1
  • tests/phpunit/Drupal/SettingsTestCase.php

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Walkthrough

The settings test setup now includes the CLAMAV_ prefix in its list of environment-variable prefixes to filter.

Changes

Settings test environment

Layer / File(s) Summary
Environment-variable filtering
tests/phpunit/Drupal/SettingsTestCase.php
ALLOWED_ENV_VARS now includes CLAMAV_.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 6d3f9

The settings tests clear inherited ClamAV values while preserving values set by individual cases, and the Acquia installer fixtures inherit the updated baseline. No outstanding merge risk is evident.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #3230 requires adding 'CLAMAV_' to SettingsTestCase::ALLOWED_ENV_VARS and regenerating the installer fixture copies. The reviewed source change adds the prefix in `tests/phpunit/Drupal/Setti… Provide reviewable evidence that all required installer fixture copies contain the 'CLAMAV_' entry, or remove the exclusion for those paths.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: clearing inherited CLAMAV_ variables during settings tests.
Out of Scope Changes check Passed The reviewed source change and the reported installer fixture regeneration directly implement issue #3230. No unrelated change is identified in the available whole-PR evidence.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Linked Issues check

Explanation

Issue #3230 requires adding 'CLAMAV_' to SettingsTestCase::ALLOWED_ENV_VARS and regenerating the installer fixture copies. The reviewed source change adds the prefix in tests/phpunit/Drupal/SettingsTestCase.php, which satisfies the primary code change. The required fixture paths are excluded from review, so their regenerated contents cannot be established independently. The PR description reports that the fixtures were regenerated, but the excluded files prevent a complete coding assessment.

Resolution

Provide reviewable evidence that all required installer fixture copies contain the 'CLAMAV_' entry, or remove the exclusion for those paths.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the test-run air,
CLAMAV_ joins the filtered list.
No inherited host can sneak in there,
No port can change the expected twist.
The settings tests begin with care,
And nibble carrots as they pass.

Comment @coderabbitai help to get the list of available commands.

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (233/233)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (233/233)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@github-actions

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6ad9984b8c14a5f20337cd73--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.09%. Comparing base (807fc1e) to head (6d3f9e7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3231      +/-   ##
==========================================
- Coverage   92.28%   92.09%   -0.20%     
==========================================
  Files         113      105       -8     
  Lines        5097     4931     -166     
  Branches       49        3      -46     
==========================================
- Hits         4704     4541     -163     
+ Misses        393      390       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Oct 22, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit 922e041 into main Oct 22, 2026
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/3230-clamav-env-vars branch October 22, 2026 11:03
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Oct 22, 2026
AlexSkrypnyk added a commit that referenced this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 Board worker 1 Needs review Pull request needs a review from assigned developers

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Clear inherited 'CLAMAV_' variables in the settings tests

1 participant