Skip to content

Commit

Permalink
Enha: More Integration Tests (#130)
Browse files Browse the repository at this point in the history
This PR expands on the work of @vaind and PR #128 and adds an integration test for the remaining actions.
  • Loading branch information
denrase authored Jul 12, 2022
1 parent 8a0265c commit d14fc64
Show file tree
Hide file tree
Showing 15 changed files with 448 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: sudo gem install fastlane

- name: Run integration tests
run: ./integration.sh
run: test/integration-test.sh
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ inherit_mode:
- Include

AllCops:
TargetRubyVersion: 2.6
Include:
- '**/fastlane/Fastfile'
Exclude:
Expand Down
73 changes: 71 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,77 @@ lane :integration_test_upload_dif do
sentry_upload_dif(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
url: "http://127.0.0.1:8000",
auth_token: 'dummy-auth-token',
path: './assets/SwiftExample.app.dSYM.zip',
url: "http://127.0.0.1:8000"
path: './assets/SwiftExample.app.dSYM.zip'
)
end

lane :integration_test_create_release do
sentry_create_release(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
version: '1.1.0',
app_identifier: "com.sentry.fastlane.app"
)
end

lane :integration_test_set_commits do
sentry_set_commits(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
version: '1.1.0',
commit: "sentry/sentry-fastlane-plugin@369affccf9e6570cb52275d1c0dfb7e016fe6cb8"
)
end

lane :integration_test_create_deploy do
sentry_create_deploy(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
version: '1.1.0',
app_identifier: "com.sentry.fastlane.app",
env: 'production'
)
end

lane :integration_test_upload_file do
sentry_upload_file(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
version: '1.1.0',
app_identifier: "com.sentry.fastlane.app",
file: 'assets/AndroidExample.mapping.txt'
)
end

lane :integration_test_upload_sourcemap do
sentry_upload_sourcemap(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
version: '1.1.0',
app_identifier: "com.sentry.fastlane.app",
sourcemap: 'assets/AndroidExample.mapping.txt'
)
end

lane :integration_test_upload_proguard do
sentry_upload_proguard(
org_slug: 'sentry-sdks',
project_slug: 'sentry-fastlane-plugin',
auth_token: 'dummy-auth-token',
url: "http://127.0.0.1:8000",
android_manifest_path: "assets/AndroidManifest.xml",
mapping_path: 'assets/AndroidExample.mapping.txt'
)
end
85 changes: 73 additions & 12 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,94 @@
fastlane documentation
================
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
```sh
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

### test

```sh
[bundle exec] fastlane test
```
fastlane test
```



### test_big

```sh
[bundle exec] fastlane test_big
```



### integration_test_upload_dif

```sh
[bundle exec] fastlane integration_test_upload_dif
```



### integration_test_create_release

```sh
[bundle exec] fastlane integration_test_create_release
```



### integration_test_set_commits

```sh
[bundle exec] fastlane integration_test_set_commits
```



### integration_test_create_deploy

```sh
[bundle exec] fastlane integration_test_create_deploy
```



### integration_test_upload_file

```sh
[bundle exec] fastlane integration_test_upload_file
```
fastlane test_big



### integration_test_upload_sourcemap

```sh
[bundle exec] fastlane integration_test_upload_sourcemap
```



### integration_test_upload_proguard

```sh
[bundle exec] fastlane integration_test_upload_proguard
```



----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
21 changes: 0 additions & 21 deletions integration.sh

This file was deleted.

111 changes: 111 additions & 0 deletions test/assets/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sample.app"
android:versionCode="11"
android:versionName="1.1.0" >

<uses-sdk
android:minSdkVersion="26"
android:targetSdkVersion="32" />

<uses-permission android:name="android.permission.INTERNET" />

<queries>
<package android:name="androidx.test.orchestrator" />
<package android:name="androidx.test.services" />
<package android:name="com.google.android.apps.common.testing.services" />
</queries>

<application
android:name="com.sample.app"
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:dataExtractionRules="@xml/data_extraction_rules"
android:extractNativeLibs="false"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SampleApp" >
<activity
android:name="com.sample.app.MainActivity"
android:exported="true"
android:theme="@style/Theme.SampleApp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="io.sentry.auto-init"
android:value="false" />

<activity
android:name="androidx.compose.ui.tooling.PreviewActivity"
android:exported="true" /> <!-- 'android:authorities' must be unique in the device, across all apps -->
<provider
android:name="io.sentry.android.core.SentryInitProvider"
android:authorities="com.sample.app.SentryInitProvider"
android:exported="false" />
<provider
android:name="io.sentry.android.core.SentryPerformanceProvider"
android:authorities="com.sample.app.SentryPerformanceProvider"
android:exported="false"
android:initOrder="200" />
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.sample.app.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.profileinstaller.ProfileInstallerInitializer"
android:value="androidx.startup" />
</provider>

<service
android:name="androidx.room.MultiInstanceInvalidationService"
android:directBootAware="true"
android:exported="false" /> <!-- The activities will be merged into the manifest of the hosting app. -->
<activity
android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
android:exported="false"
android:stateNotNeeded="true"
android:theme="@style/Theme.PlayCore.Transparent" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.play.billingclient.version"
android:value="4.1.0" />

<activity
android:name="com.android.billingclient.api.ProxyBillingActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />

<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:directBootAware="false"
android:enabled="true"
android:exported="true"
android:permission="android.permission.DUMP" >
<intent-filter>
<action android:name="androidx.profileinstaller.action.INSTALL_PROFILE" />
</intent-filter>
<intent-filter>
<action android:name="androidx.profileinstaller.action.SKIP_FILE" />
</intent-filter>
</receiver>
</application>

</manifest>
10 changes: 10 additions & 0 deletions test/assets/artifact.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "fixture-id",
"sha1": "fixture-sha1",
"name": "fixture-name",
"size": 1,
"dist": null,
"headers": {
"fixture-header-key": "fixture-header-value"
}
}
5 changes: 5 additions & 0 deletions test/assets/assemble-artifacts-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"state": "ok",
"missingChunks": [],
"detail": null
}
15 changes: 15 additions & 0 deletions test/assets/associate-dsyms-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"associatedDsymFiles": [
{
"uuid": null,
"debugId": null,
"objectName": "fixture-objectName",
"cpuName": "fixture-cpuName",
"sha1": "fixture-sha1",
"data": {
"type": null,
"features": ["fixture-feature"]
}
}
]
}
13 changes: 13 additions & 0 deletions test/assets/debug-info-files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"uuid": null,
"debugId": null,
"objectName": "fixture-objectName",
"cpuName": "fixture-cpuName",
"sha1": "fixture-sha1",
"data": {
"type": null,
"features": ["fixture-feature"]
}
}
]
8 changes: 8 additions & 0 deletions test/assets/deploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "1",
"environment": "production",
"dateStarted": null,
"dateFinished": "2022-01-01T12:00:00.000000Z",
"name": "fixture-deploy",
"url": null
}
Loading

0 comments on commit d14fc64

Please sign in to comment.