Skip to content

Commit

Permalink
Chore: Removing integration tests (#2916)
Browse files Browse the repository at this point in the history
Both Alamofire and Home Assistant integration tests are causing more trouble then helping, we will remove this CI tests.

Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
  • Loading branch information
brustolin and philipphofmann authored Apr 18, 2023
1 parent 904d7fa commit f168340
Show file tree
Hide file tree
Showing 11 changed files with 354 additions and 517 deletions.
141 changes: 0 additions & 141 deletions .github/workflows/integration-tests.yml

This file was deleted.

6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ run-test-server:
cd ./test-server && swift run &
.PHONY: run-test-server

test-alamofire:
./scripts/test-alamofire.sh

test-homekit:
./scripts/test-homekit.sh

analyze:
rm -rf analyzer
xcodebuild analyze -workspace Sentry.xcworkspace -scheme Sentry -configuration Release CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" CODE_SIGNING_ALLOWED="NO" | xcpretty -t && [[ -z `find analyzer -name "*.html"` ]]
Expand Down
13 changes: 13 additions & 0 deletions develop-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,16 @@ For the swizzling of UIViewControllers and NSURLSession, we have UI tests runnin
tests on iOS 12 simulators is acceptable. This decision reverts [manually installing iOS 12 simulators](#ios-12-simulators).

Related to [GH-2862](https://github.com/getsentry/sentry-cocoa/issues/2862) and

### Remove integration tests from CI <a name="remove-integration-tests-from-ci"></a>

Date: April 17th 2023
Contributors: @brustolin @philipphofmann

Both Alamofire and Home Assistance integration tests are no longer reliable as they keep failing and causing more problems than adding value.
These tests used to work for a while, and we know that the Sentry SDK was not breaking these projects.
Therefore, we have decided to remove the tests and add some key files to our list of risk files.
This way, if these files are changed, we will be reminded to test the changes with other projects.
Additionally, two new 'make' commands(test-alamofire, test-homekit) are being added to the project to assist in testing the Sentry SDK in third-party projects.

Related to [GH-2916](https://github.com/getsentry/sentry-cocoa/pull/2916)
Original file line number Diff line number Diff line change
@@ -1,105 +1,92 @@
diff --git a/Alamofire.xcodeproj/project.pbxproj b/Alamofire.xcodeproj/project.pbxproj
index 3882645..56fea58 100644
index 3882645e..a1c24fdf 100644
--- a/Alamofire.xcodeproj/project.pbxproj
+++ b/Alamofire.xcodeproj/project.pbxproj
@@ -409,6 +409,7 @@
4CFB030E1D7D2FA20056F249 /* utf8_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */; };
@@ -410,6 +410,7 @@
4CFB030F1D7D2FA20056F249 /* utf8_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */; };
4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; };
+ 7B4C98B52743C1FE00B03EC9 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 7B4C98B42743C1FE00B03EC9 /* Sentry */; };
8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; };
+ D8D0FEC029ED312200BA68B6 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = D8D0FEBF29ED312200BA68B6 /* Sentry */; };
E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; };
E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; };
@@ -623,6 +624,7 @@
isa = PBXFrameworksBuildPhase;
E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; };
@@ -570,6 +571,7 @@
B39E2F871C1A72F8002DA1A9 /* certPEM.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = certPEM.crt; path = selfSignedAndMalformedCerts/certPEM.crt; sourceTree = "<group>"; };
B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */ = {isa = PBXFileReference; lastKnownFileType = file; name = randomGibberish.crt; path = selfSignedAndMalformedCerts/randomGibberish.crt; sourceTree = "<group>"; };
B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */ = {isa = PBXFileReference; lastKnownFileType = file; name = keyDER.der; path = selfSignedAndMalformedCerts/keyDER.der; sourceTree = "<group>"; };
+ D8D0FEBD29ED310A00BA68B6 /* sentry-cocoa */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "sentry-cocoa"; path = ../..; sourceTree = "<group>"; };
E4202FE01B667AA100C997FB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F8111E3319A95C8B0040E7D1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F8111E3719A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -638,6 +640,7 @@
buildActionMask = 2147483647;
files = (
+ 7B4C98B52743C1FE00B03EC9 /* Sentry in Frameworks */,
8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */,
+ D8D0FEC029ED312200BA68B6 /* Sentry in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -962,6 +964,13 @@
path = String;
@@ -976,14 +979,31 @@
name = "Varying Encoding Types and Extensions";
sourceTree = "<group>";
};
+ 7BF0E78F274B938400873798 /* Frameworks */ = {
+ D8D0FEBC29ED310A00BA68B6 /* Packages */ = {
+ isa = PBXGroup;
+ children = (
+ D8D0FEBD29ED310A00BA68B6 /* sentry-cocoa */,
+ );
+ name = Packages;
+ sourceTree = "<group>";
+ };
+ D8D0FEBE29ED312200BA68B6 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */ = {
F8111E2919A95C8B0040E7D1 = {
isa = PBXGroup;
children = (
@@ -984,6 +993,7 @@
+ D8D0FEBC29ED310A00BA68B6 /* Packages */,
4CE292381EF4B116008DA555 /* Deployment */,
4CE292301EF4A386008DA555 /* Documentation */,
F8111E3519A95C8B0040E7D1 /* Source */,
F8111E3F19A95C8B0040E7D1 /* Tests */,
F8111E3419A95C8B0040E7D1 /* Products */,
+ 7BF0E78F274B938400873798 /* Frameworks */,
+ D8D0FEBE29ED312200BA68B6 /* Frameworks */,
);
indentWidth = 4;
sourceTree = "<group>";
@@ -1152,6 +1162,8 @@
dependencies = (
@@ -1206,6 +1226,9 @@
F8111E6619A967880040E7D1 /* PBXTargetDependency */,
);
name = "Alamofire macOS";
name = "Alamofire iOS Tests";
+ packageProductDependencies = (
+ D8D0FEBF29ED312200BA68B6 /* Sentry */,
+ );
productName = AlamofireOSX;
productReference = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */;
productType = "com.apple.product-type.framework";
@@ -1188,6 +1200,9 @@
dependencies = (
);
name = "Alamofire iOS";
+ packageProductDependencies = (
+ 7B4C98B42743C1FE00B03EC9 /* Sentry */,
+ );
productName = Alamofire;
productReference = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */;
productType = "com.apple.product-type.framework";
@@ -1281,6 +1296,9 @@
Base,
);
mainGroup = F8111E2919A95C8B0040E7D1;
+ packageReferences = (
+ 7B4C98B32743C1FE00B03EC9 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
+ );
productRefGroup = F8111E3419A95C8B0040E7D1 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -2379,6 +2397,25 @@
productName = AlamofireTests;
productReference = F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
@@ -2379,6 +2402,13 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+ 7B4C98B32743C1FE00B03EC9 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/getsentry/sentry-cocoa";
+ requirement = {
+ kind = revision;
+ revision = __GITHUB_REVISION_PLACEHOLDER__;
+ };
+ };
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 7B4C98B42743C1FE00B03EC9 /* Sentry */ = {
+ D8D0FEBF29ED312200BA68B6 /* Sentry */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 7B4C98B32743C1FE00B03EC9 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
+ productName = Sentry;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = F8111E2A19A95C8B0040E7D1 /* Project object */;
}
diff --git a/Tests/BaseTestCase.swift b/Tests/BaseTestCase.swift
index 1eeafe7..f5f3dea 100644
index 1eeafe7a..d24465ec 100644
--- a/Tests/BaseTestCase.swift
+++ b/Tests/BaseTestCase.swift
@@ -25,8 +25,38 @@
@@ -25,8 +25,37 @@
import Alamofire
import Foundation
import XCTest
Expand All @@ -108,12 +95,11 @@ index 1eeafe7..f5f3dea 100644
+private var SentryInitialized = false

class BaseTestCase: XCTestCase {
+
+ private static var transaction: Span!
+
+
+ override class func setUp() {
+ super.setUp()
+
+
+ if (!SentryInitialized) {
+ SentrySDK.start { options in
+ options.dsn = "https://6cc9bae94def43cab8444a99e0031c28@o447951.ingest.sentry.io/5428557"
Expand All @@ -122,19 +108,19 @@ index 1eeafe7..f5f3dea 100644
+ options.enableFileIOTracing = true
+ options.profilesSampleRate = 1.0
+ }
+
+
+ SentryInitialized = true
+ }
+
+
+ // Bind transaction to scope so we add spans to it
+ transaction = SentrySDK.startTransaction(name: "Alamofire", operation: "alamofire", bindToScope: true)
+ }
+
+
+ override class func tearDown() {
+ super.tearDown()
+ transaction.finish()
+ }
+
+
let timeout: TimeInterval = 10

var testDirectoryURL: URL {
Loading

0 comments on commit f168340

Please sign in to comment.