Skip to content

Commit

Permalink
Update Sync E2E tests for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Sep 12, 2024
1 parent c75c6ca commit c670c8c
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/sync_end_to_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,30 @@ on:
- cron: '0 5 * * *' # run at 5 AM UTC

jobs:
create-notarized-app:
name: Prepare DMG Release
uses: ./.github/workflows/build_notarized.yml
with:
release-type: review
create-dmg: false
branch: ${{ github.ref_name }}
secrets:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_ACCESS_KEY_ID_RELEASE_S3: ${{ secrets.AWS_ACCESS_KEY_ID_RELEASE_S3 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY_RELEASE_S3: ${{ secrets.AWS_SECRET_ACCESS_KEY_RELEASE_S3 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MM_HANDLES_BASE64: ${{ secrets.MM_HANDLES_BASE64 }}
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}

sync-end-to-end-tests:
name: Sync End-to-End Tests
needs: create-notarized-app
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -43,9 +65,11 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
run: |
bundle exec fastlane sync_signing_dmg_review
bundle exec fastlane sync_signing_ci
- name: Download and unzip artifact
uses: actions/download-artifact@v4

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
Expand Down Expand Up @@ -79,14 +103,18 @@ jobs:
- name: Build Sync e2e tests
run: |
set -o pipefail && xcodebuild build-for-testing \
-scheme "Sync End-to-End UI Tests" \
-configuration Review \
-scheme "Sync End-to-End UI Tests CI" \
-derivedDataPath DerivedData \
-skipPackagePluginValidation \
-skipMacroValidation \
| tee xcodebuild.log \
| xcbeautify
- name: Unzip and Copy app to /DerivedData
run: |
cd DuckDuckGo-review-*.app && unzip DuckDuckGo-*.zip
mv -f "DuckDuckGo Review.app" "../DerivedData/Build/Products/CI/DuckDuckGo Review.app"
- name: Run UI Tests
env:
CODE: ${{ steps.sync-recovery-code.outputs.recovery-code }}
Expand All @@ -99,14 +127,13 @@ jobs:
-i '/Scheme/LaunchAction/EnvironmentVariables/EnvironmentVariable[1]' -t attr -n "key" -v "CODE" \
-i '/Scheme/LaunchAction/EnvironmentVariables/EnvironmentVariable[1]' -t attr -n "value" -v "$CODE" \
-i '/Scheme/LaunchAction/EnvironmentVariables/EnvironmentVariable[1]' -t attr -n "isEnabled" -v "YES" \
"DuckDuckGo.xcodeproj/xcshareddata/xcschemes/Sync End-to-End UI Tests.xcscheme" > updated.xcscheme
mv -f updated.xcscheme "DuckDuckGo.xcodeproj/xcshareddata/xcschemes/Sync End-to-End UI Tests.xcscheme"
"DuckDuckGo.xcodeproj/xcshareddata/xcschemes/Sync End-to-End UI Tests CI.xcscheme" > updated.xcscheme
mv -f updated.xcscheme "DuckDuckGo.xcodeproj/xcshareddata/xcschemes/Sync End-to-End UI Tests CI.xcscheme"
defaults write com.duckduckgo.macos.browser.review sync.environment Development
defaults write com.duckduckgo.macos.browser.review moveToApplicationsFolderAlertSuppress 1
set -o pipefail && xcodebuild test-without-building \
-scheme "Sync End-to-End UI Tests" \
-configuration Review \
-scheme "Sync End-to-End UI Tests CI" \
-derivedDataPath DerivedData \
-skipPackagePluginValidation \
-skipMacroValidation \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Review"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "killall tests-server&#10;# integration tests resources dir&#10;pushd &quot;${METAL_LIBRARY_OUTPUT_DIR}&quot;&#10;&quot;${BUILT_PRODUCTS_DIR}/tests-server&quot; &amp;&#10;popd&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B1AD89C25FC27E200261379"
BuildableName = "Integration Tests.xctest"
BlueprintName = "Integration Tests"
ReferencedContainer = "container:DuckDuckGo.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "killall tests-server&#10;">
</ActionContent>
</ExecutionAction>
</PostActions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "565E46DC2B2725DC0013AC2A"
BuildableName = "SyncE2EUITests.xctest"
BlueprintName = "SyncE2EUITests"
ReferencedContainer = "container:DuckDuckGo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Review"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AA585D7D248FD31100E9A3E2"
BuildableName = "DuckDuckGo.app"
BlueprintName = "DuckDuckGo Privacy Browser"
ReferencedContainer = "container:DuckDuckGo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints YES"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_DT_MODE"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "debug"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

0 comments on commit c670c8c

Please sign in to comment.