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

PrimeTweenManager not created when running multiple PlayMode tests #83

Closed
Leo-gp opened this issue Jun 20, 2024 · 2 comments
Closed

PrimeTweenManager not created when running multiple PlayMode tests #83

Leo-gp opened this issue Jun 20, 2024 · 2 comments

Comments

@Leo-gp
Copy link

Leo-gp commented Jun 20, 2024

When multiple PlayMode tests are run (by "Run All" or "Run Selected" with multiple selected tests), the PrimeTweenManager game object is only created in the first test. The following ones do not have the PrimeTweenManager created.

@KyryloKuzyk
Copy link
Owner

PrimeTweenManager is created once before all other scripts (BeforeSceneLoad) and should be never destroyed after that because of DontDestroyOnLoad(). When the first PlayMode test is executed, PrimeTweenManager should be created and all other following tests will use the same PrimeTweenManager instance. Is this not the case for you?

One potential corner case I can imagine is that if any of your tests exit the PlayMode by doing something like EditorApplication.isPlaying = false;, then it may cause issues because PrimeTweenManager.Instance will be set to null inside the EditorApplication.playModeStateChanged callback. Can you please tell me if any of your tests do something like that?

PrimeTween comes with a lot of runtime tests and you can enable them by adding these lines to your manifest.json file. Can you check if they work for you correctly?

"testables": [
    "com.kyrylokuzyk.primetween"
  ]

@Leo-gp
Copy link
Author

Leo-gp commented Jun 22, 2024

I was able to identify the issue after your input. My PlayMode tests use Zenject's SceneTestFixture, and its LoadScenes method as well as its Teardown run a method DestroyEverythingExceptTestRunner, and from there, it's self-explanatory...
I just modified it so it also doesn't destroy the PrimeTweenManager.
Thanks for helping!

@Leo-gp Leo-gp closed this as completed Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants