adobe / aepsdk-edge-ios

Adobe Experience Platform Edge Network mobile extension in Swift
Apache License 2.0
13 stars 24 forks source link

JSON comparison parity - test cases #402

Closed timkimadobe closed 1 year ago

timkimadobe commented 1 year ago

Description

This PR splits test coverage into parameterized and unit test cases, and provides more comprehensive, systematic coverage of the JSON comparison feature. It brings the iOS implementation in line with the latest Android changes.

Please see https://github.com/adobe/aepsdk-edge-android/pull/79 for reference, specifically:

Question for reviewers: The parameterized tests use XCTContext.runActivity to create separate test cases, however errors in Xcode are presented differently; now the left side panel Test navigator that shows the individual test cases serves as an overall pass/fail indicator for the whole group of parameterized tests - is this an acceptable change? Are there any other format or logging updates that are required in this case?

Screenshot 2023-09-19 at 5 01 58 PM

and individual parameterized test cases can be seen in the Report navigator.

Screenshot 2023-09-19 at 5 03 38 PM

The following is an example of the console output that would be seen in Xcode and CI systems:

Test Suite 'Selected tests' started at 2023-09-19 16:59:44.966
Test Suite 'UpstreamIntegrationTests.xctest' started at 2023-09-19 16:59:44.967
Test Suite 'AnyCodableAssertsParameterizedTests' started at 2023-09-19 16:59:44.967
Test Case '-[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching]' started.
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:31: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("1") is not equal to ("2") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:32: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("Optional(1)") is not equal to ("Optional(2)") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:31: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("5.0") is not equal to ("2.0") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:32: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("Optional(5.0)") is not equal to ("Optional(2.0)") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:31: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("true") is not equal to ("false") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:32: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("Optional(true)") is not equal to ("Optional(false)") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:31: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("a") is not equal to ("b") - Key path: 
.../aepsdk-edge-ios/Tests/UpstreamIntegrationTests/AnyCodableAssertsParameterizedTests.swift:32: error: -[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching] : XCTAssertEqual failed: ("Optional("a")") is not equal to ("Optional("b")") - Key path: 
Test Case '-[UpstreamIntegrationTests.AnyCodableAssertsParameterizedTests testValueMatching]' failed (0.125 seconds).
Test Suite 'AnyCodableAssertsParameterizedTests' failed at 2023-09-19 16:59:45.093.
     Executed 1 test, with 8 failures (0 unexpected) in 0.125 (0.126) seconds
Test Suite 'UpstreamIntegrationTests.xctest' failed at 2023-09-19 16:59:45.093.
     Executed 1 test, with 8 failures (0 unexpected) in 0.125 (0.127) seconds
Test Suite 'Selected tests' failed at 2023-09-19 16:59:45.093.
     Executed 1 test, with 8 failures (0 unexpected) in 0.125 (0.127) seconds
Program ended with exit code: 1

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #402 (1b1456e) into feature/json-comparison-parity (d7e511e) will not change coverage. The diff coverage is n/a.

@@                       Coverage Diff                       @@
##           feature/json-comparison-parity     #402   +/-   ##
===============================================================
  Coverage                           96.77%   96.77%           
===============================================================
  Files                                  27       27           
  Lines                                1671     1671           
===============================================================
  Hits                                 1617     1617           
  Misses                                 54       54