From 78473c23d9dfedfda6ed9bb61ad30d6b5b87f32b Mon Sep 17 00:00:00 2001 From: xiaoweii Date: Wed, 10 Apr 2024 18:21:36 +0800 Subject: [PATCH] chore: update test case add code coverage token --- .github/workflows/test.yml | 3 ++- Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift | 2 +- Tests/ClickstreamTests/IntegrationTest.swift | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b19e8b..3a31ffd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,9 @@ jobs: cd ../../../../ xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage .build/Build/Products/Debug-iphonesimulator/Clickstream.o > .build/info.lcov - name: Upload Test Report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} name: report files: .build/info.lcov swift: true diff --git a/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift b/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift index 69e6d7e..29d0005 100644 --- a/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift +++ b/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift @@ -359,7 +359,7 @@ class EventRecorderTest: XCTestCase { eventRecorder.submitEvents() XCTAssertEqual(1, eventRecorder.queue.operationCount) - Thread.sleep(forTimeInterval: 0.5) + Thread.sleep(forTimeInterval: 0.8) let totalEvent = try dbUtil.getEventCount() XCTAssertEqual(0, totalEvent) XCTAssertTrue(eventRecorder.bundleSequenceId == 3) diff --git a/Tests/ClickstreamTests/IntegrationTest.swift b/Tests/ClickstreamTests/IntegrationTest.swift index 9825c1b..01abbf2 100644 --- a/Tests/ClickstreamTests/IntegrationTest.swift +++ b/Tests/ClickstreamTests/IntegrationTest.swift @@ -134,7 +134,7 @@ class IntegrationTest: XCTestCase { let testEvent = try getTestEvent() let eventAttribute = testEvent["attributes"] as! [String: Any] - XCTAssertEqual("AppStore", eventAttribute[ClickstreamAnalytics.Attr.APP_INSTALL_CHANNEL] as! String) + XCTAssertEqual("App Store", eventAttribute[ClickstreamAnalytics.Attr.APP_INSTALL_CHANNEL] as! String) XCTAssertEqual(5.1, eventAttribute["level"] as! Double) XCTAssertEqual(5, eventAttribute["class"] as! Int) XCTAssertEqual(true, eventAttribute["isOpenNotification"] as! Bool)