Skip to content

Refactor tests to use AEPTestUtils#433

Merged
timkimadobe merged 12 commits intoadobe:devfrom
timkimadobe:testing-refactor
Nov 15, 2023
Merged

Refactor tests to use AEPTestUtils#433
timkimadobe merged 12 commits intoadobe:devfrom
timkimadobe:testing-refactor

Conversation

@timkimadobe
Copy link
Copy Markdown
Contributor

@timkimadobe timkimadobe commented Nov 8, 2023

Note

The Podfile dependency currently points to a branch of the testutils repo - this can be updated to point to a particular tag (once release tag is created) using the syntax, ex: pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '1.0.0-beta'

Description

This PR brings in the AEPTestUtils library and replaces existing local versions of test utilities with the following changes:

  1. Import AEPTestUtils in all dependent classes
  2. Refactor EdgeStateTests.swift helper method: getPropertiesFromMockDataStore to accommodate Core 4.2.0 new persistence format for objects (String instead of Data)
    3. Temporary update to include UnitTests prefix to assertEquals method due to compiler preference for instance method from AEPTestUtils extension to XCTestCase for JSON comparison over global function defined in UnitTests module
    • Note that this is temporary to allow unit tests to pass, and will be replaced in a followup PR that uses the JSON comparison system for dictionary comparisons
    • UnitTests. prefix is no longer needed since the AnyCodable JSON comparison methods have been refactored to be a custom protocol instead

The classes were mostly drop in replacements since the AEPTestUtils classes were based on the original Edge versions of the classes.

NOTE: Refactor to use the JSON comparison tool for functional and unit tests will be done as a followup PR to help with ease of review process

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 8, 2023

Codecov Report

Merging #433 (ae4328a) into dev (e6d961a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev     #433   +/-   ##
=======================================
  Coverage   96.76%   96.76%           
=======================================
  Files          27       27           
  Lines        1730     1730           
=======================================
  Hits         1674     1674           
  Misses         56       56           

@timkimadobe timkimadobe changed the title Testing refactor to use AEPTestUtils Refactor tests to use AEPTestUtils Nov 9, 2023
@timkimadobe timkimadobe linked an issue Nov 9, 2023 that may be closed by this pull request
@timkimadobe timkimadobe merged commit 74a67e5 into adobe:dev Nov 15, 2023
@timkimadobe timkimadobe deleted the testing-refactor branch November 15, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor functional and integration tests to use new test utils

2 participants