From dc85cb10ed40c908d981494e8e5d82cecd16fcf1 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 5 Sep 2024 13:49:56 +0300 Subject: [PATCH] Stop running and publishing performance metrics to gh-pages --- .github/workflows/integration-tests.yml | 17 ------ ElementX.xcodeproj/project.pbxproj | 4 -- .../Sources/PerformanceTests.swift | 55 ------------------- Tools/Scripts/parsePerformanceMetrics.sh | 25 --------- 4 files changed, 101 deletions(-) delete mode 100644 IntegrationTests/Sources/PerformanceTests.swift delete mode 100755 Tools/Scripts/parsePerformanceMetrics.sh diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 808c4c03a2..2207b15514 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -59,23 +59,6 @@ jobs: path: ~/Library/Logs/scan/IntegrationTests-IntegrationTests.log retention-days: 2 if-no-files-found: ignore - - - name: Checkout gh-pages branch (for perf stats) - if: always() - uses: actions/checkout@v4 - with: - ref: gh-pages - path: gh-pages - - - name: Post-process archive to obtain performance metrics and upload to gh-pages - if: always() - run: | - ./Tools/Scripts/parsePerformanceMetrics.sh ~/Library/Logs/scan/IntegrationTests-IntegrationTests.log $GITHUB_SHA | tee perf-results.csv - cat perf-results.csv >> $GITHUB_WORKSPACE/gh-pages/performance/perf-data.csv - cd $GITHUB_WORKSPACE/gh-pages/performance/ - git add . - git commit -m "Results for $GITHUB_SHA" - git push - name: Collect coverage run: xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/IntegrationTests.xcresult > fastlane/test_output/integration-cobertura.xml diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index e83dc01dc5..e978482c46 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -819,7 +819,6 @@ B79E8AB83EBBDCD476D0362F /* PollFormScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = D622EC7898469BB1D0881CDD /* PollFormScreen.swift */; }; B7C9E07F4F9CCC8DD7156A20 /* CallScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28146817C61423CACCF942F5 /* CallScreenModels.swift */; }; B818580464CFB5400A3EF6AE /* TimelineModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 029D5701F80A9AF7167BB4D0 /* TimelineModels.swift */; }; - B828C600A54B2EE20871A451 /* PerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD700E035C85738EE4B97129 /* PerformanceTests.swift */; }; B879446FD8E65A711EF8F9F7 /* AdvancedSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */; }; B89990DD875B0B603D4D4332 /* NotificationItemProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B927CF5EF7FCCDA5EDC474B /* NotificationItemProxyProtocol.swift */; }; B93D7CE520088AD53FA6D53C /* SettingsScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B663BE498BB39EADC24025D /* SettingsScreenModels.swift */; }; @@ -2068,7 +2067,6 @@ CCF71646898A2F720C5BFDF5 /* RoomDirectorySearchScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreenViewModel.swift; sourceTree = ""; }; CD469F7513574341181F7EAA /* ServerSelectionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerSelectionScreen.swift; sourceTree = ""; }; CD6613DE16AD26B3A74DA1F5 /* LocationRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineItemContent.swift; sourceTree = ""; }; - CD700E035C85738EE4B97129 /* PerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PerformanceTests.swift; sourceTree = ""; }; CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = ""; }; @@ -3333,7 +3331,6 @@ children = ( D33116993D54FADC0C721C1F /* Application.swift */, D1BC84BA0AF11C2128D58ABD /* Common.swift */, - CD700E035C85738EE4B97129 /* PerformanceTests.swift */, 9C4048041C1A6B20CB97FD18 /* TestMeasurementParser.swift */, 21DD8599815136EFF5B73F38 /* UserFlowTests.swift */, ); @@ -6945,7 +6942,6 @@ 1702981A8085BE4FB0EC001B /* Application.swift in Sources */, 388D39ED9FE1122EA6D76BF2 /* Common.swift in Sources */, A439B456D0761D6541745CC3 /* NSRegularExpresion.swift in Sources */, - B828C600A54B2EE20871A451 /* PerformanceTests.swift in Sources */, 88356DE7F2AD243AB10C7B7A /* Signposter.swift in Sources */, 290FDB0FFDC2F1DDF660343E /* TestMeasurementParser.swift in Sources */, 32B7891D937377A59606EDFC /* UserFlowTests.swift in Sources */, diff --git a/IntegrationTests/Sources/PerformanceTests.swift b/IntegrationTests/Sources/PerformanceTests.swift deleted file mode 100644 index d5540234c8..0000000000 --- a/IntegrationTests/Sources/PerformanceTests.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright 2022 New Vector Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import XCTest - -class PerformanceTests: XCTestCase { - func testLoginFlow() throws { - let parser = TestMeasurementParser() - parser.capture(testCase: self) { - let metrics: [XCTMetric] = [ - XCTApplicationLaunchMetric(), - XCTClockMetric(), - XCTOSSignpostMetric(subsystem: Signposter.subsystem, category: Signposter.category, name: "\(Signposter.Name.login)"), - XCTOSSignpostMetric(subsystem: Signposter.subsystem, category: Signposter.category, name: "\(Signposter.Name.firstSync)"), - XCTOSSignpostMetric(subsystem: Signposter.subsystem, category: Signposter.category, name: "\(Signposter.Name.firstRooms)"), - XCTOSSignpostMetric(subsystem: Signposter.subsystem, category: Signposter.category, name: "\(Signposter.Name.roomFlow)") - ] - - self.measure(metrics: metrics) { - self.runLoginLogoutFlow() - } - } - } - - private func runLoginLogoutFlow() { - let app = Application.launch() - - app.login(currentTestCase: self) - - // Open the first room in the list. - let firstRoom = app.buttons.matching(NSPredicate(format: "identifier BEGINSWITH %@", A11yIdentifiers.homeScreen.roomNamePrefix)).firstMatch - XCTAssertTrue(firstRoom.waitForExistence(timeout: 10.0)) - firstRoom.tap() - - // Go back to the room list - let backButton = app.navigationBars.firstMatch.buttons["Chats"] - XCTAssertTrue(backButton.waitForExistence(timeout: 10.0)) - backButton.tap() - - app.logout() - } -} diff --git a/Tools/Scripts/parsePerformanceMetrics.sh b/Tools/Scripts/parsePerformanceMetrics.sh deleted file mode 100755 index c34f5e39fd..0000000000 --- a/Tools/Scripts/parsePerformanceMetrics.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Parses performance metrics from the full report of a IntegrationTest run (do not use xcpretty first!) -# This file can normally be found in `~/Library/Logs/scan/IntegrationTests-IntegrationTests.log` - -# Provide file as $1 -# Provide identifier (eg, date, GITHUB_SHA) as $2 - -echo "Parsing $1 for test results with identifier $2" >&2 - -NOW=`date -u -Iminutes` - -# Find all the measurement lines in the file, then strip out the gumph into a CSV-like format. -grep ".*measured.*values" $1 | sed -e "s/.*Test Case .*-\[//" -e "s/\]' measured \[/,/" -e "s/\].*values: \[/,/" -e "s/\], performance.*//" -e "s/^/$2,/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Duration .AppLaunch., s/launchPerformance/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Duration .Login., s/loginPerformance/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Duration .RoomFlow., s/roomFlowPerformance/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Duration .FirstRooms., s/firstRoomsPerformance/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Duration .FirstSync., s/firstSyncPerformance/" \ - -e "s/IntegrationTests.PerformanceTests testLoginFlow,Clock Monotonic Time, s/totalTime/" \ - -e "s/^/$NOW,/" - -# The output should contain fields for the identifier, name, type, unit, then a list of recorded values (normally 5) - -# Put this into a file somewhere for later usage.