-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Json for Sentry config #80
Conversation
Please notice, currently the json config generated dynamically and not included in the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great already!
I left some notes to discuss and suggestions for the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach is great! Will also perform better and since we're anyway dependant on S.T.J might as well use it.
Good thing now we can take advantage of that nice testing infrastrucutre you've setup to get these code tested. Will be particularly nice to make sure the serialization round-trip works. Would also be good to have some snapshot tests to validate we're not introducing breakage on serialzied files, as we ship new versions
public void SentryTestWindow_OpenAndLinkXmlCopied_Successful() | ||
{ | ||
LogAssert.ignoreFailingMessages = true; // mandatory | ||
|
||
// Open & Close window to trigger 'link.xml' logic | ||
SentryTestWindow.Open().Dispose(); | ||
|
||
var linkXmlPath = $"{Application.dataPath}/Resources/{UnitySentryOptions.ConfigRootFolder}/link.xml"; | ||
Assert.IsTrue(File.Exists(linkXmlPath)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about we make sure it wasn't there to begin with. Or should we delete it before the test runs?
public void SentryTestWindow_OpenAndLinkXmlCopied_Successful() | |
{ | |
LogAssert.ignoreFailingMessages = true; // mandatory | |
// Open & Close window to trigger 'link.xml' logic | |
SentryTestWindow.Open().Dispose(); | |
var linkXmlPath = $"{Application.dataPath}/Resources/{UnitySentryOptions.ConfigRootFolder}/link.xml"; | |
Assert.IsTrue(File.Exists(linkXmlPath)); | |
} | |
public void SentryTestWindow_OpenAndLinkXmlCopied_Successful() | |
{ | |
var linkXmlPath = $"{Application.dataPath}/Resources/{UnitySentryOptions.ConfigRootFolder}/link.xml"; | |
Assert.IsFalse(File.Exists(linkXmlPath)); // sanity check | |
LogAssert.ignoreFailingMessages = true; // mandatory | |
// Open & Close window to trigger 'link.xml' logic | |
SentryTestWindow.Open().Dispose(); | |
Assert.IsTrue(File.Exists(linkXmlPath)); | |
} | |
var jsonRaw = File.ReadAllText(optionsFilePath); | ||
using var jsonDocument = JsonDocument.Parse(jsonRaw); | ||
|
||
UnitySentryOptions.FromJson(jsonDocument.RootElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the asserts I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to be merged though, the other notes could be a follow up PR.
Thanks!
No
ScriptableObject
for Sentry config. Quick & dirty.UnitySentryOptions
reusedlink.xml
must be placed inside Unity project for IL2CPP builds to workAPI 30
(Android 11, ARM, please read notes below) viaAndroid Studio
emulator*.apk
size ~19mb*.apk
size ~29mbNote: currently the json config generated dynamically and not included in the project.
Android notes:
Unity
dropped support forx86_x86
forAndroid
.Android Studio
recommendation is to use emulator images which are based onx86
, butUnity
builds only forARM
.ARM
is much slower in terms of performance. Google recently made an update forx86
images to supportARM
in a performant way, but it works only forAPI 30
(Android 11).If you try to use any previous

ARM
based images which are not tuned forx86
, you will see the following messageIt's so slow that I didn't wait enough for it to start...
This is an example of how it looks inside
AVD
.Android 11
usesx86-ARM-comptaible
arch, whileAndroid 4.4
usesplain-old-ARM
Another option is to use something like Blustacks or Genymotion (they also provide Android-as-a-Service). I had some
Hyper-V
problems running Bluestacks, because of aDocker
which is always running on my system.