Skip to content

[AMSDK-10255] Make Identity a hard dependency for ExEdge requests#53

Merged
emdobrin merged 8 commits intoadobe:devfrom
kevinlind:amsdk-10255
Jul 28, 2020
Merged

[AMSDK-10255] Make Identity a hard dependency for ExEdge requests#53
emdobrin merged 8 commits intoadobe:devfrom
kevinlind:amsdk-10255

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

@kevinlind kevinlind commented Jul 27, 2020

Description

AEP Mobile Extension will not send network requests if Identity shared state is pending. If the Identity shared state exists, but no ECID exists, the network request is still sent without the ECID. This use-case will be revisited when opt-out controls are implemented as no ECID indicates the user has oped-out of Identity.

  • Add IdentityStateFunctionalTests for test cases which need to manipulate the Identity shared state
  • Adds FakeIdentityExtension which allows a unit tests to set and clear the Identity shared state
  • Adds new Xcode target functionalTestsIdentity to run these new tests independently of other functional tests. This is needed to reset the SDK of any previously registered Identity extension.

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.

…state.

Functional tests verify Identity shared state is a hard dependency before sending a network request to ExEdge. Adds a FakeIdentityExtension which allows the setting and clearing of the Identity shared state. These function tests are added to a new Xcode target so they are run independently from other functional tests. This is needed now as there is currently no way to reset the SDK for testing.
@kevinlind kevinlind requested a review from emdobrin July 27, 2020 23:36
/* Begin PBXNativeTarget section */
BF024B8024CF93DF002131E9 /* functionalTestsIdentity */ = {
isa = PBXNativeTarget;
buildConfigurationList = BF024B9624CF93DF002131E9 /* Build configuration list for PBXNativeTarget "functionalTestsIdentity" */;
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 makes me sad 😢 I wish we could reset the hub soon.


/// Extension used to 'fake' an Identity extension and allows tests to clear and set the Identity shared state. Use it along with `FunctionalTestBase`
/// Cannot be used along with another Identity Extension which is registered with ACPCore.
class FakeIdentityExtension: ACPExtension {
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.

Can we make this extension more generic, something like FakeMobileExtension and be able to use this for any extension we need? The name needs to be customizable.

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.

We talked offline about this. It's difficult to make this customizable given how the extensions are registered in the SDK. This may become easier once we switch to the Swift Core, or once we have the ability to reset the SDK, we can use the actual Identity extension for testing.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 28, 2020

Codecov Report

Merging #53 into dev will decrease coverage by 0.40%.
The diff coverage is 57.89%.

@@            Coverage Diff             @@
##              dev      #53      +/-   ##
==========================================
- Coverage   78.08%   77.69%   -0.40%     
==========================================
  Files          29       29              
  Lines         981      995      +14     
==========================================
+ Hits          766      773       +7     
- Misses        215      222       +7     

@emdobrin emdobrin merged commit 29b868c into adobe:dev Jul 28, 2020
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.

2 participants