Skip to content

Commit

Permalink
Update slow unit tests (#23027)
Browse files Browse the repository at this point in the history
  • Loading branch information
kean authored Apr 18, 2024
2 parents 2f5b235 + ddd39f7 commit ec96b15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 43 deletions.
4 changes: 0 additions & 4 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,6 @@
C7F7BDD026262A4C00CE547F /* AppDependency.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7F7BDCF26262A4C00CE547F /* AppDependency.swift */; };
C7F7BE0726262B9A00CE547F /* AuthenticationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7F7BE0626262B9900CE547F /* AuthenticationHandler.swift */; };
C7F7BE4C2626301500CE547F /* AuthenticationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7F7BE0626262B9900CE547F /* AuthenticationHandler.swift */; };
C80512FE243FFD4B00B6B04D /* TenorDataSouceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C856749B243F462F001A995E /* TenorDataSouceTests.swift */; };
C81CCD63243AECA100A83E27 /* TenorClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81CCD5E243AECA000A83E27 /* TenorClient.swift */; };
C81CCD64243AECA100A83E27 /* TenorMediaObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81CCD5F243AECA000A83E27 /* TenorMediaObject.swift */; };
C81CCD65243AECA200A83E27 /* TenorGIF.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81CCD60243AECA100A83E27 /* TenorGIF.swift */; };
Expand Down Expand Up @@ -8468,7 +8467,6 @@
C8567495243F3D37001A995E /* TenorResultsPageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TenorResultsPageTests.swift; sourceTree = "<group>"; };
C8567497243F41CA001A995E /* MockTenorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTenorService.swift; sourceTree = "<group>"; };
C8567499243F4292001A995E /* TenorMockDataHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TenorMockDataHelper.swift; sourceTree = "<group>"; };
C856749B243F462F001A995E /* TenorDataSouceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TenorDataSouceTests.swift; sourceTree = "<group>"; };
C8FC2DE857126670AE377B5D /* Pods-WordPressScreenshotGeneration.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressScreenshotGeneration.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressScreenshotGeneration/Pods-WordPressScreenshotGeneration.debug.xcconfig"; sourceTree = "<group>"; };
C9264D275F6288F66C33D2CE /* Pods-WordPressTest.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressTest.release-internal.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressTest/Pods-WordPressTest.release-internal.xcconfig"; sourceTree = "<group>"; };
C94C0B1A25DCFA0100F2F69B /* FilterableCategoriesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterableCategoriesViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -16399,7 +16397,6 @@
C8567495243F3D37001A995E /* TenorResultsPageTests.swift */,
C8567497243F41CA001A995E /* MockTenorService.swift */,
C8567499243F4292001A995E /* TenorMockDataHelper.swift */,
C856749B243F462F001A995E /* TenorDataSouceTests.swift */,
);
path = Tenor;
sourceTree = "<group>";
Expand Down Expand Up @@ -23864,7 +23861,6 @@
80C523AB29AE6C2200B1C14B /* BlazeCreateCampaignWebViewModelTests.swift in Sources */,
D848CBFF20FF010F00A9038F /* FormattableCommentContentTests.swift in Sources */,
8332DD2829259BEB00802F7D /* DataMigratorTests.swift in Sources */,
C80512FE243FFD4B00B6B04D /* TenorDataSouceTests.swift in Sources */,
323F8F3023A22C4C000BA49C /* SiteCreationRotatingMessageViewTests.swift in Sources */,
FF1FD02620912AA900186384 /* URL+LinkNormalizationTests.swift in Sources */,
4A76A4BD29D43BFD00AABF4B /* CommentService+MorderationTests.swift in Sources */,
Expand Down

This file was deleted.

10 changes: 5 additions & 5 deletions WordPress/WordPressTest/PagesListTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PagesListTests: CoreDataTestCase {
let randomID = UniquePool<Int>(range: 1...999999)

func testFlatList() throws {
let total = 1000
let total = 200
let pages = (1...total).map { id in
let page = PageBuilder(mainContext).build()
page.postID = NSNumber(value: id)
Expand Down Expand Up @@ -45,11 +45,11 @@ class PagesListTests: CoreDataTestCase {

func testHugeNestedLists() throws {
var pages = [Page]()
for _ in 1...100 {
for _ in 1...40 {
pages.append(contentsOf: parentPage(childrenCount: 5, additionalLevels: 4))
}
// Add orphan pages
for _ in 1...50 {
for _ in 1...20 {
let newPages = parentPage(childrenCount: 5)
newPages[0].parentID = NSNumber(value: randomID.next())
pages.append(contentsOf: newPages)
Expand All @@ -59,7 +59,7 @@ class PagesListTests: CoreDataTestCase {
}

// Measure performance using a page list where somewhat reflects a real-world page list, where some pages whose parent pages are in list.
func testPerformance() throws {
func _testPerformance() throws {
// Make sure the total number of pages is about the same as the one in `testWorstPerformance`.
var pages = [Page]()
// Add pages whose parents are in the list.
Expand All @@ -83,7 +83,7 @@ class PagesListTests: CoreDataTestCase {
}

// Measure performance using a page list where contains non-top-level pages and none of their parent pages are in the list.
func testWorstPerformance() throws {
func _testWorstPerformance() throws {
var pages = [Page]()
for id in 1...5000 {
let page = PageBuilder(mainContext).build()
Expand Down

0 comments on commit ec96b15

Please sign in to comment.