Skip to content
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

Replace TestSelector with ResourceTypeSelector #10718

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Sep 16, 2024

Resolves NA

Problem

The TestSelector class was introduced in #2628, but it doesn't need to offer anything differentiated anymore.

Solution

Simplify by standardizing upon the ResourceTypeSelector.

This was accomplished by:

  1. replacing all instances of TestSelector with ResourceTypeSelector
  2. removing the TestSelector class

Some history of the TestSelector class

To help us avoid a Chesterton's fence situation:

  1. was first introduced in #2628 merged on 2020-07-20
    • contained two differentiated attributes: data and schema
    • contained a differentiated method: expand_selection
  2. modified 1 day later in #2629
    • removed differentiated attributes: data and schema
  3. modified 9 months later in #3235
    • removed differentiated method: expand_selection

Additional information

Doing this simple refactor makes it easy to see the root cause of the bug report in #10727.

Refactoring first will make it easier to review the code changes in #10706 (which will also resolve #10727).

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • Tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.).
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Sep 16, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@dbeatty10 dbeatty10 added the Skip Changelog Skips GHA to check for changelog file label Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.88%. Comparing base (16f5023) to head (9f65a92).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10718      +/-   ##
==========================================
- Coverage   88.88%   88.88%   -0.01%     
==========================================
  Files         180      180              
  Lines       22856    22851       -5     
==========================================
- Hits        20316    20311       -5     
  Misses       2540     2540              
Flag Coverage Δ
integration 86.08% <100.00%> (-0.01%) ⬇️
unit 62.42% <25.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.42% <25.00%> (-0.01%) ⬇️
Integration Tests 86.08% <100.00%> (-0.01%) ⬇️

@dbeatty10 dbeatty10 marked this pull request as ready for review September 16, 2024 15:12
@dbeatty10 dbeatty10 requested a review from a team as a code owner September 16, 2024 15:12
@dbeatty10 dbeatty10 changed the title [tidy first] Replace TestSelector with ResourceTypeSelector Replace TestSelector with ResourceTypeSelector Sep 16, 2024
@dbeatty10 dbeatty10 removed the Skip Changelog Skips GHA to check for changelog file label Sep 17, 2024
@dbeatty10 dbeatty10 marked this pull request as ready for review September 18, 2024 16:29
@dbeatty10 dbeatty10 merged commit 9e633f6 into main Sep 18, 2024
63 of 64 checks passed
@dbeatty10 dbeatty10 deleted the dbeatty/tidy-first-10656 branch September 18, 2024 20:13
peterallenwebb pushed a commit that referenced this pull request Sep 20, 2024
* [tidy first] Replace `TestSelector` with `ResourceTypeSelector`

* Changelog entry

* Fully preserve current behavior

* Revert "Fully preserve current behavior"

This reverts commit ceecfec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] --resource-type test includes both data tests and unit tests
2 participants