acquia / cli

Acquia CLI
GNU General Public License v2.0
42 stars 47 forks source link

CLI-1389: Catch datastore validation errors in tests #1796

Closed danepowell closed 1 week ago

danepowell commented 1 week ago

Motivation

Fixes CLI-1389

Proposed changes

Improve tests to catch validation errors in datastores to prevent regressions like CLI-1389

Calling set() on a keystore doesn't trigger validation. Validation only occurs when the contents of the datastore file are loaded from disk. So test cases should never use set() for configuring a test fixture, but rather write the file and reload the command/datastore.

Testing steps

  1. Follow the contribution guide to set up your development environment or download a pre-built acli.phar for this PR.
  2. Clear the kernel cache to pick up new and changed commands: ./bin/acli ckc
  3. Change destination_git_urls to destination-git-urls (i.e., revert #1789)
  4. See that tests fail
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.23%. Comparing base (81703a7) to head (a772a8d). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1796 +/- ## ========================================= Coverage 92.23% 92.23% Complexity 1817 1817 ========================================= Files 121 121 Lines 6823 6823 ========================================= Hits 6293 6293 Misses 530 530 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 week ago

Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1796/acli.phar

curl -OL https://acquia-cli.s3.amazonaws.com/build/pr/1796/acli.phar
chmod +x acli.phar