chore: fix failing unity tests on windows player builds - #294
Conversation
…ow processed if scoped attributes don't exist
melekr
left a comment
There was a problem hiding this comment.
Nice cleanup. The platform specific skips look appropriate: Android stack trace parsing is compiled only for Android/Editor and the DisableInEditor assertions are editor only by design.
One small suggestion: GetScopedAttributes()now reads legacy PlayerPrefs attributes even when the scoped key list is missing, but the legacy migration path deletes those old PlayerPrefs keys without calling PlayerPrefs.Save(). Since this is part of the Windows startup/minidump flow, an explicit save after deleting legacy keys would make the cleanup deterministic and avoid relying on a later PlayerPrefs flush.
Maybe worth adding PlayerPrefs.Save() at the end of ScopedNativeAttributesTests.CleanState() after PlayerPrefs.DeleteAll() in Player test runs?
Good suggestions! For the Player test runs, since we run |
Summary
Fixes tests that passed in the Editor but failed with Player, fixed a bug in the Windows native client which was causing mishandling of legacy attributes, guard a few tests that should only run in the Editor or Android.
Changes
NativeClient:GetScopedAttributesno longer returns early when there's no scoped list, so legacy attributes are still migrated on upgrade. Save PlayerPrefs after removing legacy keys.HasScopedAttributesEmptytoHasScopedAttributes, which returns true when attributes exist.ScopedNativeAttributesTests: clear PlayerPrefs in[SetUp]so tests don't inherit state from earlier Player runs.BacktraceClientDisableTests: skip theDisableInEditortests in Player builds, should be Editor only.BacktraceStackTraceTests: skip the Android stack trace tests in Player builds, should be Android/Editor only