Skip to content

Added upstream integration tests for configOverrides feature#413

Merged
addb merged 10 commits intoadobe:feature/datastreamConfigOverridefrom
addb:ConfigOverrideIntegrationTest
Oct 11, 2023
Merged

Added upstream integration tests for configOverrides feature#413
addb merged 10 commits intoadobe:feature/datastreamConfigOverridefrom
addb:ConfigOverrideIntegrationTest

Conversation

@addb
Copy link
Copy Markdown
Contributor

@addb addb commented Sep 28, 2023

Description

Integration tests for configOverrides and Konductor responses.

Sample Integration test run: https://github.com/addb/aepsdk-edge-ios/actions/runs/6357026574/job/17267558942

Failing Tests: (Expecting 400 from Konductor, but for some reason getting 200)

  • testSendEvent_withInvalidConfigOverrides_receivesExpectedNetworkResponseError
  • testSendEvent_withInvalidConfigOverrides_notConfiguredValues_receivesExpectedNetworkResponseError
  • testSendEvent_withInvalidConfigOverrides_dummyValues_receivesExpectedNetworkResponseError
  • testSendEvent_withInvalidConfigOverrides_containingValidAndDummyValues_receivesExpectedNetworkResponseError

Enable above tests after PDCL-11131 issue is fixed:

Screenshot 2023-10-11 at 4 11 29 PM

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.

@addb addb linked an issue Sep 28, 2023 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 29, 2023

Codecov Report

Merging #413 (4e0eada) into feature/datastreamConfigOverride (43ffd59) will not change coverage.
The diff coverage is n/a.

@@                        Coverage Diff                        @@
##           feature/datastreamConfigOverride     #413   +/-   ##
=================================================================
  Coverage                             96.76%   96.76%           
=================================================================
  Files                                    27       27           
  Lines                                  1729     1729           
=================================================================
  Hits                                   1673     1673           
  Misses                                   56       56           

@addb addb requested a review from emdobrin September 29, 2023 20:58
@addb addb marked this pull request as ready for review September 29, 2023 21:00
…ase and TestHelpers. Refactored some helper code to make it extensible and reusable.
@addb addb requested a review from emdobrin October 3, 2023 23:12
@addb addb requested a review from timkimadobe October 4, 2023 00:17
Comment on lines +60 to +66
// Set Edge location hint value if one is set for the test target
if edgeLocationHint != nil {
print("Setting Edge location hint to: \(String(describing: edgeLocationHint?.rawValue))")
Edge.setLocationHint(edgeLocationHint?.rawValue)
} else {
print("No preset Edge location hint is being used for this test.")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be an EdgeHelper too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you thinking when you say as a helper? I have pushed some updates, but I think I might have not extracted this lcoationHint and edgeEnvironment as per your thinking. Let me know if I missed something in the updates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to L56 -> L62 which can be extracted in TestBase+EdgeHelpers in a simple func setInitialLocationHint(edgeLocationHint) so all tests can use it as is and also save some lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not move that since we don't register Edge extension in the TestBase.

@addb addb requested a review from emdobrin October 6, 2023 22:33
Copy link
Copy Markdown
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some responses below, looks great

Comment on lines +60 to +66
// Set Edge location hint value if one is set for the test target
if edgeLocationHint != nil {
print("Setting Edge location hint to: \(String(describing: edgeLocationHint?.rawValue))")
Edge.setLocationHint(edgeLocationHint?.rawValue)
} else {
print("No preset Edge location hint is being used for this test.")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to L56 -> L62 which can be extracted in TestBase+EdgeHelpers in a simple func setInitialLocationHint(edgeLocationHint) so all tests can use it as is and also save some lines

@addb addb merged commit 007f9f0 into adobe:feature/datastreamConfigOverride Oct 11, 2023
addb added a commit that referenced this pull request Oct 24, 2023
* Update Experience Event class for Datastream Config Override Feature (#397)

* Modify Experience event class to add datastreamIdOverride and datastreamConfigOverride fields.

* Updates based on reviews

* format fixes

* Review updates

* Add more unit test

---------

Co-authored-by: Kevin Lind <40409666+kevinlind@users.noreply.github.com>

* Update documentation for Datastream Override Feature (#399)

* Update documentation for datastream override feature

* Added objective c sample and made changes based on reviews

* Formatting fixes

* Updates based on reviews

* Datastream Id Override and Datastream Config Override Implementation (#398)

* Implemented Datastream Id override and Datastream config override feature. Refactored processHit function for readability and swift lint warnings.

* Added unit tests for the override feature

* Add Functional tests

* formatting fix

* Refactored code based on reviews

* Updates based on reviews

* More review updates

* Test update

* Updates based on reviews

* Update Codecov configuration

* Added upstream integration tests for configOverrides feature (#413)

* Added upstream integration tests for configOverrides feature

* Updates based on reviews

* Assert errors

* format fixes

* Moved ConfigOverrides test in a separate file. Moved helpers to TestBase and TestHelpers. Refactored some helper code to make it extensible and reusable.

* Move edge helpers to a separate extension of TestBase

* Updates based on reviews

* Updates based on reviews

* More updates based on reviews

* Skipping tests till Konductor issue PDCL-11131 is fixed

---------

Co-authored-by: Kevin Lind <40409666+kevinlind@users.noreply.github.com>
Co-authored-by: Emilia Dobrin <33132425+emdobrin@users.noreply.github.com>
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.

Add Integration tests for Datastream Override Feature

3 participants