From dd1351d84a5f2e53939041c0f11b50cdad154525 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Tue, 30 Nov 2021 09:06:36 -0500 Subject: [PATCH] test: packaging with validation (#440) Co-authored-by: bitsandfoxes --- .github/workflows/ci.yml | 24 ++ CONTRIBUTING.md | 9 + scripts/pack.ps1 | 1 + .../package-release.zip.snapshot | 341 ++++++++++++++++++ test/Scripts.Tests/test-pack-contents.ps1 | 47 +++ 5 files changed, 422 insertions(+) create mode 100644 test/Scripts.Tests/package-release.zip.snapshot create mode 100755 test/Scripts.Tests/test-pack-contents.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b0bfb2db..aa8e43fa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -241,6 +241,30 @@ jobs: name: Test results (editmode) path: artifacts/test/editmode + package-validation: + needs: [build] + name: UPM Package validation + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v2.3.3 + + - name: Download UPM package + uses: actions/download-artifact@v2 + with: + # Artifact name is the commit sha. Which is what craft uses to find the relevant artifact. + name: ${{ github.sha }} + + - name: Verify package content against snapshot + shell: pwsh + # If this step fails, you can accept the new file content by + # running the following script locally with 'accept' as an argument + # and committing the new snapshot file to your branch. i.e: + # pwsh ./test/Scripts.Tests/test-pack-contents.ps1 accept + run: ./test/Scripts.Tests/test-pack-contents.ps1 + android-smoke-test: needs: [build] name: Smoke Test - Android ${{ matrix.api-level }} Unity ${{ matrix.unity-version }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e93d1f931..4f2a0c73e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -138,6 +138,15 @@ In order to run the tests * open `TestRunner` via `Windows -> General -> Test Runner` * run `PlayMode` or `EditMode` tests +### Package validation + +In CI, a workflow validates that the content of the package doesn't change accidentally. +If you intentially want to add or remove files in the final UPM package. You need to accept the diff: + +``` +pwsh ./test/Scripts.Tests/test-pack-contents.ps1 accept +``` + ## Release The release is done by pushing the artifact built in CI [to a new repo](https://github.com/getsentry/unity). The artifact is built by using the template files in the `package` directory. In order to make a release, the contents of `package-dev/Editor` and `package-dev/Runtime` folders should be copied into `package`. diff --git a/scripts/pack.ps1 b/scripts/pack.ps1 index 56d338f44..1b7522f71 100644 --- a/scripts/pack.ps1 +++ b/scripts/pack.ps1 @@ -1,3 +1,4 @@ +Remove-Item "package-release" -Recurse -ErrorAction SilentlyContinue New-Item "package-release" -ItemType Directory $exclude = @( diff --git a/test/Scripts.Tests/package-release.zip.snapshot b/test/Scripts.Tests/package-release.zip.snapshot new file mode 100644 index 000000000..15b6eed12 --- /dev/null +++ b/test/Scripts.Tests/package-release.zip.snapshot @@ -0,0 +1,341 @@ +Documentation~/index.md +Editor/iOS.meta +Editor/sentry-cli.meta +Editor/Sentry.Unity.Editor.dll +Editor/Sentry.Unity.Editor.dll.meta +Editor/iOS/Sentry.Unity.Editor.iOS.dll +Editor/iOS/Sentry.Unity.Editor.iOS.dll.meta +Editor/sentry-cli/sentry-cli-Darwin-universal +Editor/sentry-cli/sentry-cli-Darwin-universal.meta +Editor/sentry-cli/sentry-cli-Linux-x86_64 +Editor/sentry-cli/sentry-cli-Linux-x86_64.meta +Editor/sentry-cli/sentry-cli-Windows-x86_64.exe +Editor/sentry-cli/sentry-cli-Windows-x86_64.exe.meta +Plugins/Android.meta +Plugins/iOS.meta +Plugins/iOS/Device.meta +Plugins/iOS/SentryNativeBridge.m +Plugins/iOS/SentryNativeBridge.m.meta +Plugins/iOS/Simulator.meta +Plugins/iOS/Simulator/Sentry.framework.meta +Plugins/iOS/Simulator/Sentry.framework/_CodeSignature.meta +Plugins/iOS/Simulator/Sentry.framework/Headers.meta +Plugins/iOS/Simulator/Sentry.framework/Info.plist +Plugins/iOS/Simulator/Sentry.framework/Info.plist.meta +Plugins/iOS/Simulator/Sentry.framework/Modules.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders.meta +Plugins/iOS/Simulator/Sentry.framework/Sentry +Plugins/iOS/Simulator/Sentry.framework/Sentry.meta +Plugins/iOS/Simulator/Sentry.framework/_CodeSignature/CodeResources +Plugins/iOS/Simulator/Sentry.framework/_CodeSignature/CodeResources.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryLog.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryLog.h.meta +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryRequestOperation.h +Plugins/iOS/Simulator/Sentry.framework/PrivateHeaders/SentryRequestOperation.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/PrivateSentrySDKOnly.h +Plugins/iOS/Simulator/Sentry.framework/Headers/PrivateSentrySDKOnly.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/Sentry.h +Plugins/iOS/Simulator/Sentry.framework/Headers/Sentry.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryAppStartMeasurement.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryAppStartMeasurement.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryAttachment.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryAttachment.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryBreadcrumb.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryBreadcrumb.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryClient.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryClient.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryCrashExceptionApplication.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryCrashExceptionApplication.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDebugImageProvider.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDebugImageProvider.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDebugMeta.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDebugMeta.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDefines.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDefines.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDsn.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryDsn.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEnvelope.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEnvelope.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEnvelopeItemType.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEnvelopeItemType.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryError.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryError.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEvent.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryEvent.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryException.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryException.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryFrame.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryFrame.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryHub.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryHub.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryId.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryId.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryIntegrationProtocol.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryIntegrationProtocol.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMechanism.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMechanism.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMechanismMeta.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMechanismMeta.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMessage.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryMessage.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryNSError.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryNSError.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryOptions.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryOptions.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySampleDecision.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySampleDecision.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySamplingContext.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySamplingContext.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryScope.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryScope.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryScreenFrames.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryScreenFrames.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySDK.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySDK.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySdkInfo.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySdkInfo.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySerializable.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySerializable.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySession.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySession.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanContext.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanContext.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanId.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanId.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanProtocol.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanProtocol.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanStatus.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentrySpanStatus.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryStacktrace.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryStacktrace.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryThread.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryThread.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryTraceHeader.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryTraceHeader.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryTransactionContext.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryTransactionContext.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryUser.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryUser.h.meta +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryUserFeedback.h +Plugins/iOS/Simulator/Sentry.framework/Headers/SentryUserFeedback.h.meta +Plugins/iOS/Simulator/Sentry.framework/Modules/module.modulemap +Plugins/iOS/Simulator/Sentry.framework/Modules/module.modulemap.meta +Plugins/iOS/Device/Sentry.framework.meta +Plugins/iOS/Device/Sentry.framework/Headers.meta +Plugins/iOS/Device/Sentry.framework/Info.plist +Plugins/iOS/Device/Sentry.framework/Info.plist.meta +Plugins/iOS/Device/Sentry.framework/Modules.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders.meta +Plugins/iOS/Device/Sentry.framework/Sentry +Plugins/iOS/Device/Sentry.framework/Sentry.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryLog.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryLog.h.meta +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryRequestOperation.h +Plugins/iOS/Device/Sentry.framework/PrivateHeaders/SentryRequestOperation.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/PrivateSentrySDKOnly.h +Plugins/iOS/Device/Sentry.framework/Headers/PrivateSentrySDKOnly.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/Sentry.h +Plugins/iOS/Device/Sentry.framework/Headers/Sentry.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryAppStartMeasurement.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryAppStartMeasurement.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryAttachment.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryAttachment.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryBreadcrumb.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryBreadcrumb.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryClient.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryClient.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryCrashExceptionApplication.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryCrashExceptionApplication.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryDebugImageProvider.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryDebugImageProvider.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryDebugMeta.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryDebugMeta.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryDefines.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryDefines.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryDsn.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryDsn.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryEnvelope.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryEnvelope.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryEnvelopeItemType.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryEnvelopeItemType.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryError.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryError.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryEvent.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryEvent.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryException.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryException.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryFrame.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryFrame.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryHub.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryHub.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryId.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryId.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryIntegrationProtocol.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryIntegrationProtocol.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryMechanism.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryMechanism.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryMechanismMeta.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryMechanismMeta.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryMessage.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryMessage.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryNSError.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryNSError.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryOptions.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryOptions.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySampleDecision.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySampleDecision.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySamplingContext.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySamplingContext.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryScope.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryScope.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryScreenFrames.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryScreenFrames.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySDK.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySDK.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySdkInfo.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySdkInfo.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySerializable.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySerializable.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySession.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySession.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanContext.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanContext.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanId.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanId.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanProtocol.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanProtocol.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanStatus.h +Plugins/iOS/Device/Sentry.framework/Headers/SentrySpanStatus.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryStacktrace.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryStacktrace.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryThread.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryThread.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryTraceHeader.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryTraceHeader.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryTransactionContext.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryTransactionContext.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryUser.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryUser.h.meta +Plugins/iOS/Device/Sentry.framework/Headers/SentryUserFeedback.h +Plugins/iOS/Device/Sentry.framework/Headers/SentryUserFeedback.h.meta +Plugins/iOS/Device/Sentry.framework/Modules/module.modulemap +Plugins/iOS/Device/Sentry.framework/Modules/module.modulemap.meta +Plugins/Android/Sentry.meta +Plugins/Android/Sentry/gson-2.8.5.jar +Plugins/Android/Sentry/gson-2.8.5.jar.meta +Plugins/Android/Sentry/sentry-5.4.0.jar +Plugins/Android/Sentry/sentry-5.4.0.jar.meta +Plugins/Android/Sentry/sentry-android-core-release.aar +Plugins/Android/Sentry/sentry-android-core-release.aar.meta +Plugins/Android/Sentry/sentry-android-ndk-release.aar +Plugins/Android/Sentry/sentry-android-ndk-release.aar.meta +Runtime/io.sentry.unity.runtime.asmdef +Runtime/io.sentry.unity.runtime.asmdef.meta +Runtime/Sentry.dll +Runtime/Sentry.dll.meta +Runtime/Sentry.Microsoft.Bcl.AsyncInterfaces.dll +Runtime/Sentry.Microsoft.Bcl.AsyncInterfaces.dll.meta +Runtime/Sentry.System.Buffers.dll +Runtime/Sentry.System.Buffers.dll.meta +Runtime/Sentry.System.Collections.Immutable.dll +Runtime/Sentry.System.Collections.Immutable.dll.meta +Runtime/Sentry.System.Memory.dll +Runtime/Sentry.System.Memory.dll.meta +Runtime/Sentry.System.Numerics.Vectors.dll +Runtime/Sentry.System.Numerics.Vectors.dll.meta +Runtime/Sentry.System.Reflection.Metadata.dll +Runtime/Sentry.System.Reflection.Metadata.dll.meta +Runtime/Sentry.System.Runtime.CompilerServices.Unsafe.dll +Runtime/Sentry.System.Runtime.CompilerServices.Unsafe.dll.meta +Runtime/Sentry.System.Text.Encodings.Web.dll +Runtime/Sentry.System.Text.Encodings.Web.dll.meta +Runtime/Sentry.System.Text.Json.dll +Runtime/Sentry.System.Text.Json.dll.meta +Runtime/Sentry.System.Threading.Tasks.Extensions.dll +Runtime/Sentry.System.Threading.Tasks.Extensions.dll.meta +Runtime/Sentry.Unity.Android.dll +Runtime/Sentry.Unity.Android.dll.meta +Runtime/Sentry.Unity.Android.pdb +Runtime/Sentry.Unity.Android.pdb.meta +Runtime/Sentry.Unity.dll +Runtime/Sentry.Unity.dll.meta +Runtime/Sentry.Unity.iOS.dll +Runtime/Sentry.Unity.iOS.dll.meta +Runtime/Sentry.Unity.iOS.pdb +Runtime/Sentry.Unity.iOS.pdb.meta +Runtime/Sentry.Unity.pdb +Runtime/Sentry.Unity.pdb.meta +Runtime/Sentry.xml +Runtime/Sentry.xml.meta +Runtime/SentryInitialization.cs +Runtime/SentryInitialization.cs.meta +Samples~/unity-of-bugs/Scenes.meta +Samples~/unity-of-bugs/Scripts.meta +Samples~/unity-of-bugs/Scenes/1_Bugfarm.unity +Samples~/unity-of-bugs/Scenes/1_Bugfarm.unity.meta +Samples~/unity-of-bugs/Scenes/2_MobileNativeSupport.unity +Samples~/unity-of-bugs/Scenes/2_MobileNativeSupport.unity.meta +Samples~/unity-of-bugs/Scenes/3_Transition.unity +Samples~/unity-of-bugs/Scenes/3_Transition.unity.meta +Samples~/unity-of-bugs/Scripts/BugFarmButtons.cs +Samples~/unity-of-bugs/Scripts/BugFarmButtons.cs.meta +Samples~/unity-of-bugs/Scripts/CloseGameButton.cs +Samples~/unity-of-bugs/Scripts/CloseGameButton.cs.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport.meta +Samples~/unity-of-bugs/Scripts/SmokeTester.cs +Samples~/unity-of-bugs/Scripts/SmokeTester.cs.meta +Samples~/unity-of-bugs/Scripts/TransitionSceneButtons.cs +Samples~/unity-of-bugs/Scripts/TransitionSceneButtons.cs.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/CPlugin.c +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/CPlugin.c.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/CppPlugin.cpp +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/CppPlugin.cpp.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/KotlinPlugin.kt +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/KotlinPlugin.kt.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/NativeSupportButtons.cs +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/NativeSupportButtons.cs.meta +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/ObjectiveCPlugin.m +Samples~/unity-of-bugs/Scripts/MobileNativeSupport/ObjectiveCPlugin.m.meta +CHANGELOG.md +CHANGELOG.md.meta +Editor.meta +LICENSE.md +LICENSE.md.meta +package.json +package.json.meta +Plugins.meta +README.md +README.md.meta +Runtime.meta diff --git a/test/Scripts.Tests/test-pack-contents.ps1 b/test/Scripts.Tests/test-pack-contents.ps1 new file mode 100755 index 000000000..6ebf61458 --- /dev/null +++ b/test/Scripts.Tests/test-pack-contents.ps1 @@ -0,0 +1,47 @@ +# Verifies the contents of the UPM package against a snapshot file +# 'dotnet build' and 'pack.ps1' must have already been run + +# To accept a new snapshot file, run 'pwsh ./test.ps1 accept' + +$ErrorActionPreference = "Stop" + +$projectRoot = "$PSScriptRoot/../.." +$snapshotFile = "$PSScriptRoot/package-release.zip.snapshot" +$packageFile = "$projectRoot/package-release.zip" + +Push-Location $projectRoot + +if (-not(Test-Path -Path $packageFile)) { + Write-Host "Package '$packageFile' not found. +Run 'scripts/pack.ps1' first." + exit 1 +} + +if (-not(Test-Path -Path $snapshotFile)) { + Write-Host "Snapshot file '$snapshotFile' not found. +Can't compare package contents against baseline." + exit 2 +} + +$zip = [IO.Compression.ZipFile]::OpenRead($packageFile) +try { + $snapshotContent = $zip.Entries + if ($args.Count -gt 0 -and $args[0] -eq "accept") { + # Override the snapshot file with the current package contents + $snapshotContent.FullName | Out-File $snapshotFile + } + $result = Compare-Object $snapshotContent.FullName (Get-Content $snapshotFile) + Write-Host $result + if ($result.count -eq 0) + { + Write-Host "Package contents match snapshot." + } + else + { + Write-Host "Package contents do not match snapshot." + $result | Format-Table -AutoSize + exit 3 + } +} finally{ + $zip.Dispose() +} \ No newline at end of file