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

RepeaterFieldTest::testFieldOnAcfBlock test fails when run with other test suites #101

Open
2 of 3 tasks
jasonbahl opened this issue Oct 20, 2023 · 0 comments
Open
2 of 3 tasks
Labels
help wanted Issue with a clear description that the community can help with scope: tests Developing unit tests, integration tests, and ensuring coverage type: bug Issue that causes incorrect or unexpected behavior

Comments

@jasonbahl
Copy link
Contributor

Description

The RepeaterFieldTest::testFieldOnAcfBlock test passes when the RepeaterFieldTest suite is run alone, but fails when it is ran as part of all suites.

Because of this, the test has been marked incomplete until more time can be put into diagnosing the issue.

Steps to reproduce

  1. comment out the function testFieldOnAcfBlock in RepeaterFieldTest.php
  2. run composer run-test with SUITES="wpunit:RepeaterFieldTest" defined
  3. see the suite pass
  4. run composer run-test with SUITES="wpunit" defined
  5. see all tests pass, but see RepeaterFieldTest::testFieldOnAcfBlock fail

PHP or JSON export of the ACF Field Group(s)

No response

Additional context

Because this is passing alone but failing when other tests are run, it leads me to believe there's a setup or teardown issue, but so far I've not detected anything weird with the setup or tear down.

My hunch is that some global state isn't being reset or something to that tune.

ACF Tests have a reset_acf_stores (see: https://github.com/deliciousbrains/acf/blob/develop/tests/class-test-case.php#L217-L237) so we might want to try something similar.

There is no proper unregister_acf_field / unregister_acf_field_group so our current tests register new fields/field groups with unique IDs and that could possibly be an issue somehow 🤷🏻‍♂️

WPGraphQL Version

1.17.0

WPGraphQL For ACF Version

2.0.0-beta.5.0.0

ACF (Advanced Custom Fields) Version. Free or Pro?

PRO

WordPress Version

6.2

PHP Version

8.*

Additional enviornment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL, WPGraphQL For ACF, ACF, etc.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@jasonbahl jasonbahl added scope: tests Developing unit tests, integration tests, and ensuring coverage type: bug Issue that causes incorrect or unexpected behavior labels Oct 20, 2023
@josephfusco josephfusco added the help wanted Issue with a clear description that the community can help with label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with scope: tests Developing unit tests, integration tests, and ensuring coverage type: bug Issue that causes incorrect or unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants