Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> staging [NON-RELEASE] Integration test workflow updates #518

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 23 additions & 75 deletions .github/workflows/upstream-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,83 +51,31 @@ on:
- 'EmptyString'
- 'Invalid'
- 'None'
ios-device-names:
description: |
The iOS device names to use for testing. Must be formatted as a valid JSON array string.
Example: '["iPhone 15", "iPhone 15 Pro"]'
- Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element.
type: string
default: '["iPhone 15"]'
ios-versions:
description: |
The iOS versions to use for testing. Must be formatted as a valid JSON array string.
Example: '["18.0", "18.1"]'
- Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element.
type: string
default: '["18.0"]'


run-name: ${{ inputs.id }}

jobs:
test-integration-upstream:
runs-on: macos-latest
steps:
- name: Job run identifier ${{ github.event.inputs.id }}
id: job-run-identifier
run: |
if [ -z "${{ github.event.inputs.id }}" ]; then \
echo No job run identifier was set.
else
echo 'Job run identifier is:' ${{ inputs.id }}
fi;

- name: Checkout
id: checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.branch }}

- name: Cache Cocoapods
id: cache-cocoapods
uses: actions/[email protected]
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Execute Edge Network integration tests
id: execute-integration-tests
run: make test-integration-upstream TAGS_MOBILE_PROPERTY_ID=${{ github.event.inputs.tags-mobile-property-id }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }}

# Potential workflow solutions on job failure
# All workflow setup step failures give exit code 2, with 3 as fallback
# Actual integration test failures give exit code 1
- name: On failure
id: on-failure
if: ${{ failure() }}
env:
BRANCH: ${{ github.event.inputs.branch }}
run: |
echo "Job used branch: $BRANCH. Please make sure this is the branch to run off of."

EXIT_CODE=3

if [[ "${{ steps.job-run-identifier.conclusion }}" == "failure" ]]; then
echo "Job step failed: Job run identifier."
EXIT_CODE=2
elif [[ "${{ steps.checkout.conclusion }}" == "failure" ]]; then
echo "Job step failed: Checkout."
EXIT_CODE=2
elif [[ "${{ steps.cache-cocoapods.conclusion }}" == "failure" ]]; then
echo "Job step failed: Cache Cocoapods."
EXIT_CODE=2
elif [[ "${{ steps.execute-integration-tests.conclusion }}" == "failure" ]]; then
echo "Job step failed: Execute Edge Network integration tests."
EXIT_CODE=1
else
echo "Job failed: Failure cause not identified."
fi

echo "EXIT_CODE=$EXIT_CODE" >> $GITHUB_OUTPUT

# Dynamic step name in JSON format, examples on job:
# - During job run (before this step): {"exitCode":${{ steps.on-failure.outputs.EXIT_CODE || 0 }}}
# - Failure: {"exitCode":1}
# - Success: {"exitCode":0}
- name: "{\"exitCode\":${{ steps.on-failure.outputs.EXIT_CODE || 0 }}}"
id: failure-data
if: ${{ failure() }}
run: |
echo 'exit code in the body: ${{ steps.on-failure.outputs.EXIT_CODE }}'
echo 'on-failure outputs: ${{ toJson(steps.on-failure.outputs) }}'



test-ios-integration:
name: Integration Test (iOS)
uses: adobe/aepsdk-commons/.github/workflows/[email protected]
with:
ios-device-names: ${{ inputs.ios-device-names }}
ios-versions: ${{ inputs.ios-versions }}
command: make integration-test-ios TAGS_MOBILE_PROPERTY_ID=${{ github.event.inputs.tags-mobile-property-id }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }}
enable-codecov: false
secrets: inherit
2 changes: 1 addition & 1 deletion Tests/UpstreamIntegrationTests/ConfigOverrideTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import XCTest

/// Performs validation on integration with the Edge Network upstream service
class ConfigOverrideTests: TestBase, AnyCodableAsserts {
private let TIMEOUT_SEC: TimeInterval = 30
private let TIMEOUT_SEC: TimeInterval = 45
private var edgeLocationHint: String? = TestEnvironment.defaultLocationHint
private var networkService: RealNetworkService = RealNetworkService()

Expand Down
Loading