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

Review XPASSing tests #3251

Open
7 of 8 tasks
zaneselvans opened this issue Jan 18, 2024 · 8 comments
Open
7 of 8 tasks

Review XPASSing tests #3251

zaneselvans opened this issue Jan 18, 2024 · 8 comments
Labels
ccai Tasks related to CCAI grant for entity matching ferc1 Anything having to do with FERC Form 1 testing Writing tests, creating test data, automating testing, etc.

Comments

@zaneselvans
Copy link
Member

zaneselvans commented Jan 18, 2024

We have a number of tests or data validations which are reporting XPASS in the nightly builds, which we might want to review, in case they should no longer be marked XFAIL:

@katie-lamb are the XFAIL labels for these FERC-EIA test/train tests still required / appropriate?

@zschira or @katie-lamb what do you think about the duplicate FERC years in a plant ID test? Should that be passing now?

@zaneselvans zaneselvans added ferc1 Anything having to do with FERC Form 1 testing Writing tests, creating test data, automating testing, etc. ccai Tasks related to CCAI grant for entity matching labels Jan 18, 2024
@katie-lamb
Copy link
Member

@zaneselvans A couple things re test/integration/ferc1_eia_train_test.py:

  • The first of the XPASSing test_validate_override_fixes tests ("Duplicate FERC1 ids in overrides") doesn't seem to actually be a problem in the validate_override_fixes function that this test is testing. I think this is a legitimate issue with the validate_override_fixes function that should be fixed, but the bug seems to be have been there since it's inception, not from the recently merged refactor.
  • In the remaining XPASSing test_validate_override_fixes the parameters expect_override_overrides and allow_mismatched_utilities are set to True in that test so these XPASSing tests ("EIA id already in training data.", "FERC1 id already in training data", "Utilities don't match") aren't actually getting tested/should always XPASS. It seems like it's always been that way, and maybe when this test originally went in those parameters were supposed to be set to False. When I set them to False, those tests XFAIL as expected. I can make a PR that makes those parameters less confusing and sets them to the appropriate value.
  • Finally, there's a note in the module docstring of those tests about how the record IDs used in these tests need to be updated annually to use the years from the fast_etl. It would probably just make sense to synthesize some training data so that doesn't need to be updated, or generally refactor these tests.

@katie-lamb
Copy link
Member

I'll let @zschira chime in on this as well but I think the test_dupe_years_in_plant_id_ferc1 test should now legitimately be passing.

@zaneselvans
Copy link
Member Author

@katie-lamb I don't understand what you're saying about the first XPASS. It's a real bug... but the test is passing?

It seems like these tests depend on substantial amounts of external real data right now. Are they intended only to test the functionality of restrict_train_connections_on_date_range() and validate_override_fixes() in which case it could be entirely synthetic and turned into a unit test?

Are some of these xfail markers really checking for expected failures because we're giving them known to be bad inputs which should fail? If so, then we might want to change them into tests that pass when the expected exception is raised or failure condition is observed. I couldn't tell from the messages what we really expected to be happening.

@zschira
Copy link
Member

zschira commented Jan 18, 2024

test_dupe_years_in_plant_id_ferc1 should definitely pass now. I'll remove the xfail in my open PR.

@katie-lamb
Copy link
Member

It seems like these tests depend on substantial amounts of external real data right now. Are they intended only to test the functionality of restrict_train_connections_on_date_range() and validate_override_fixes() in which case it could be entirely synthetic and turned into a unit test?

I didn't write these tests so this is only my guess, but yes I think they test the functionality of those functions and ideally would be entirely synthetic and turned into a unit test. This is what @aesharpe was referencing in the module docstring. The external real data that it depends on is the training data (contained in the package_data) so I think it would need to be refactored so that synthetic training data could be passed in.

@zaneselvans
Copy link
Member Author

If these are really meant to be unit tests, that would be great!

Are there additional integration tests that should be run when all the data is processed? Or are there already defensive checks in the EIA-FERC entity matching code that makes sure things aren't out of whack?

@katie-lamb
Copy link
Member

Probably all the consistency checks (implemented as assertions in the FERC to EIA module) should be moved into a model validation module or integration tests but I think we were planning for that after the experiment tracking goes in.

@katie-lamb
Copy link
Member

katie-lamb commented Jan 18, 2024

Ok I put the changes that need to be made to address the larger problem with this test into #3256 .

If we feel strongly about making these tests XFAIL right now, then #3257 is a patch to fix the following:

test/integration/ferc1_eia_train_test.py::test_validate_override_fixes[verified4-report_year4-record_id_eia_override_14-record_id_ferc14-utility_id_pudl_ferc14]
test/integration/ferc1_eia_train_test.py::test_validate_override_fixes[verified5-report_year5-record_id_eia_override_15-record_id_ferc15-utility_id_pudl_ferc15]
test/integration/ferc1_eia_train_test.py::test_validate_override_fixes[verified6-report_year6-record_id_eia_override_16-record_id_ferc16-utility_id_pudl_ferc16]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ccai Tasks related to CCAI grant for entity matching ferc1 Anything having to do with FERC Form 1 testing Writing tests, creating test data, automating testing, etc.
Projects
Status: New
Development

No branches or pull requests

3 participants