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

PIR End to end tests: This PR exists only to test GitHub Actions #3500

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
1c1e530
PoC Integration Test for Scan Start
aataraxiaa Jun 20, 2024
ff4f60e
Iterate on Scan Start Integration Test
aataraxiaa Jun 21, 2024
12fb9f4
Try Keychain CI Setup
aataraxiaa Jun 21, 2024
fa8d651
Iterate on file storage instead of keychain, update tests
aataraxiaa Jun 21, 2024
041e8ba
Merge branch 'pete/poc-pir-integration-tests' into elle/pir-integrati…
THISISDINOSAUR Aug 13, 2024
b6e6f69
Make broker updater use fake brokers when running integration tests
THISISDINOSAUR Aug 13, 2024
ceec0b9
Fix BrokerUpdater import
THISISDINOSAUR Aug 13, 2024
d5fa35b
Add AppKitExtensions to test targets
THISISDINOSAUR Aug 13, 2024
0ff1d03
Add static fake broker json file
THISISDINOSAUR Aug 13, 2024
c1ececa
Add initial integration tests
THISISDINOSAUR Aug 13, 2024
8517acd
Add AppKitExtensions to integration tests app store
THISISDINOSAUR Aug 13, 2024
c7a1c5f
Remove superfluous tests
THISISDINOSAUR Aug 13, 2024
f244633
Comment out possibly failing part of test
THISISDINOSAUR Aug 13, 2024
4b924b8
Revert changes to DataBrokerProtectionSecureVault
THISISDINOSAUR Aug 13, 2024
470db96
Revert "Comment out possibly failing part of test"
THISISDINOSAUR Aug 13, 2024
9529ed6
Revert keyStoreProvider
THISISDINOSAUR Aug 13, 2024
067c7c1
Restore original sandbox test tool version`
THISISDINOSAUR Aug 13, 2024
79945b5
Merge branch 'main' into elle/pir-integration-tests-for-ci-development
ayoy Aug 21, 2024
e354a38
Add new fake broker config
THISISDINOSAUR Sep 11, 2024
2e33028
Remove old fake brokers
THISISDINOSAUR Sep 11, 2024
e01be8d
Make scheduler run even more frequently
THISISDINOSAUR Sep 11, 2024
8b695b0
Update integration tests to work with the new fake broker
THISISDINOSAUR Sep 11, 2024
e1161bf
Try adding fake broker setup to CI
THISISDINOSAUR Sep 25, 2024
51eb4bb
Merge branch 'main' into elle/pir-integration-tests-for-ci-development
THISISDINOSAUR Sep 25, 2024
fe0c8b0
Fix indentation
THISISDINOSAUR Sep 25, 2024
d43db95
Add set up docker build step
THISISDINOSAUR Sep 26, 2024
446035b
Swith to running fake broker locally
loremattei Oct 7, 2024
981bb8e
Disable matrix for testing
loremattei Oct 7, 2024
fb8979b
Checkout fake broker repository
loremattei Oct 7, 2024
49becde
Give GHA access to the repo
loremattei Oct 7, 2024
b97c410
Use correct path
loremattei Oct 7, 2024
c850aeb
Configure and start fake broker
loremattei Oct 7, 2024
29f1330
Update CI config
loremattei Oct 7, 2024
24af27d
Remove tmate
loremattei Oct 9, 2024
74d6419
Change fakeBrokerAPIAddress to point to localhost
THISISDINOSAUR Oct 16, 2024
0fbb40b
Add required permissions to allow localhost access during integration…
THISISDINOSAUR Oct 16, 2024
73c085e
Remove unused docker container teardown
THISISDINOSAUR Oct 16, 2024
68791d6
Try changing token
THISISDINOSAUR Oct 16, 2024
3c2c728
Revert "Try changing token"
THISISDINOSAUR Oct 16, 2024
d989509
Try changing branch of fake broker
THISISDINOSAUR Oct 16, 2024
ba5aca1
Revert "Try changing branch of fake broker"
THISISDINOSAUR Oct 16, 2024
39496ea
Try adding persist credentials false
THISISDINOSAUR Oct 16, 2024
687c368
Revert "Try adding persist credentials false"
THISISDINOSAUR Oct 16, 2024
8115d7d
Go back to original token
THISISDINOSAUR Oct 16, 2024
dccc40f
Use ssh key instead of PAT to access fake broker repo
THISISDINOSAUR Oct 16, 2024
4ac60e1
Try to fix ssh key reading
THISISDINOSAUR Oct 16, 2024
cb0d4c7
Fix multiple ssh agent starts
THISISDINOSAUR Oct 16, 2024
04b98d7
Add ssh key to checkout step
THISISDINOSAUR Oct 16, 2024
dad6b69
Merge branch 'main' into loremattei/pir-integration-tests-for-ci
THISISDINOSAUR Oct 16, 2024
7e6b528
Add privacy config mock
THISISDINOSAUR Oct 16, 2024
5a3d10b
Add task cancelling so previously timed out expectation check don't c…
THISISDINOSAUR Oct 16, 2024
c07ca45
Stop tests from continuing after a failure
THISISDINOSAUR Oct 16, 2024
0a14e61
Clean up comments
THISISDINOSAUR Oct 16, 2024
8b7bdc4
Skip subscription checks to test CI
THISISDINOSAUR Oct 16, 2024
ecd4c6b
Readd login item running test
THISISDINOSAUR Oct 16, 2024
a25d54a
Add more comments
THISISDINOSAUR Oct 16, 2024
ad7e236
Add more check bypasses to test CI
THISISDINOSAUR Oct 16, 2024
b52026e
Comment out assert to see what happens
THISISDINOSAUR Oct 16, 2024
27bba79
Add check that returned user profile is the same as the one we tried …
THISISDINOSAUR Oct 16, 2024
22f51e5
Hard code shouldUseFakeBrokers to be true for testing purposes
THISISDINOSAUR Oct 17, 2024
2b8f3df
Add additional testing to see which brokers are being used
THISISDINOSAUR Oct 17, 2024
8814773
Add check for number of broker profile queries
THISISDINOSAUR Oct 17, 2024
d5d9ba2
Increase length of scheduler starts timeout
THISISDINOSAUR Oct 17, 2024
1da152c
Add more debugging tests
THISISDINOSAUR Oct 17, 2024
907cdf8
Change debugging check to be optional
THISISDINOSAUR Oct 17, 2024
4c1a403
Reorder tests in case broker hasn't had time to be created
THISISDINOSAUR Oct 17, 2024
911b05d
Fix scheduler check
THISISDINOSAUR Oct 17, 2024
b22ee62
Move login item checks to be earlier
THISISDINOSAUR Oct 17, 2024
751e0c6
Readd login item test
THISISDINOSAUR Oct 17, 2024
eb9ab3e
Make use non fake brokers for debugging purposes
THISISDINOSAUR Oct 18, 2024
9530e53
Remove broker checks to see if tests progress
THISISDINOSAUR Oct 18, 2024
9447938
Make test logs upload if they were cancelled
THISISDINOSAUR Oct 18, 2024
03931a5
Remove login item checks
THISISDINOSAUR Oct 18, 2024
73722be
Go back to always using fake broker
THISISDINOSAUR Oct 18, 2024
29d6ffa
Make tests continue after failure
THISISDINOSAUR Oct 18, 2024
d7eba34
Increase test timeout
THISISDINOSAUR Oct 18, 2024
ae9ddd9
Readd background agent checks
THISISDINOSAUR Oct 18, 2024
8831107
Add sleep before checking broker data
THISISDINOSAUR Oct 18, 2024
a6d0fb4
Remove posibility for tests to crash
THISISDINOSAUR Oct 18, 2024
8878944
Go back to using real brokers
THISISDINOSAUR Oct 18, 2024
6de0cbc
Rename fake broker json file
THISISDINOSAUR Oct 18, 2024
d568310
Go back to using fake broker
THISISDINOSAUR Oct 18, 2024
29057d6
Rename fake broker
THISISDINOSAUR Oct 18, 2024
946f198
Add temp test email to allow tests to progress
THISISDINOSAUR Oct 21, 2024
4230471
Make time to wait for a confirm opt out scan zero minutes
THISISDINOSAUR Oct 21, 2024
1d69c0e
Readd login item test
THISISDINOSAUR Oct 21, 2024
527db2a
Make ExecutionConfig change based on if tests are running
THISISDINOSAUR Oct 28, 2024
88d3c2d
Change broker updater back to only use fake broker configs if it's in…
THISISDINOSAUR Oct 28, 2024
7c0afcc
Update tests to include execution config mode
THISISDINOSAUR Oct 28, 2024
da52ed4
Add organization to the tests
THISISDINOSAUR Oct 28, 2024
3e4cdba
Add explanation comment to test
THISISDINOSAUR Oct 28, 2024
a17539d
Clean up leftover debugging
THISISDINOSAUR Oct 28, 2024
d3ca7c5
Merge branch 'main' into loremattei/pir-integration-tests-for-ci
THISISDINOSAUR Oct 28, 2024
8f5ac50
Make minor formatting changes
THISISDINOSAUR Oct 28, 2024
e91afdf
Rename files to be consistent with the rest of the codebase
THISISDINOSAUR Oct 29, 2024
729f315
Fix renaming extensions
THISISDINOSAUR Oct 29, 2024
7b9ef9e
Update test execution config
THISISDINOSAUR Oct 29, 2024
7e880a2
Fix rename
THISISDINOSAUR Oct 29, 2024
e39366d
Rewrite assert to use expectations to get better logging info
THISISDINOSAUR Oct 29, 2024
3fb637a
Increase opt out confirm timeout
THISISDINOSAUR Oct 29, 2024
06118d4
Change run type logic to use user defaults, so the login item can rea…
THISISDINOSAUR Oct 29, 2024
9a0e9cd
Increase login item running check timeout time
THISISDINOSAUR Oct 29, 2024
167940f
Remove early return in agent stopped
THISISDINOSAUR Oct 29, 2024
589f6bf
Move DBP E2E tests into a new target
THISISDINOSAUR Nov 1, 2024
d1108d9
Add initial yml for the new target
THISISDINOSAUR Nov 1, 2024
49967d3
Comment out unneeded part of yml file for now
THISISDINOSAUR Nov 1, 2024
fa6ff57
Fix indenting error
THISISDINOSAUR Nov 1, 2024
6c2ed3e
Make run on PR
THISISDINOSAUR Nov 1, 2024
574b643
Fix old reference to UI tests
THISISDINOSAUR Nov 1, 2024
efa5db3
Remove unnecessary build at start
THISISDINOSAUR Nov 1, 2024
377f97d
Remove old needs
THISISDINOSAUR Nov 1, 2024
5dcab7b
Make main app be in main dir
THISISDINOSAUR Nov 1, 2024
b2f754e
Fix syntax error
THISISDINOSAUR Nov 1, 2024
8dd7235
Try removing directory change for xcode select
THISISDINOSAUR Nov 1, 2024
92a6d5e
Fix missing quote
THISISDINOSAUR Nov 1, 2024
4b4305c
Change subscription manager to use environment variable token
THISISDINOSAUR Nov 1, 2024
e32f5cc
Add environment variable for privacy pro staging token to yml file
THISISDINOSAUR Nov 1, 2024
30ed13e
Add DBPE2ETests to fastlane match
ayoy Nov 4, 2024
0527078
Attempt to fix prepare test report step by adding directory switch
THISISDINOSAUR Nov 4, 2024
2588546
Merge branch 'loremattei/pir-integration-tests-for-ci' of github.com:…
THISISDINOSAUR Nov 4, 2024
8f60e11
Try changing running for older xcode version
THISISDINOSAUR Nov 4, 2024
37c1d63
Remove macOS 13 runner
THISISDINOSAUR Nov 4, 2024
55f89b2
Add if statement to run action on DBP related files changing
THISISDINOSAUR Nov 4, 2024
286ded1
Add background agent folder
THISISDINOSAUR Nov 4, 2024
ca6a144
Possibly fix trigger
THISISDINOSAUR Nov 4, 2024
a77a2fe
Test to see if branch rules work
THISISDINOSAUR Nov 4, 2024
9c20aeb
Test with full branch name
THISISDINOSAUR Nov 4, 2024
cc5ff94
Test again
THISISDINOSAUR Nov 4, 2024
7e611f7
Remove if entirely
THISISDINOSAUR Nov 4, 2024
18f2d57
Remove push rule to test pull_request rule
THISISDINOSAUR Nov 4, 2024
12fdc19
Try adding true to if statement
THISISDINOSAUR Nov 4, 2024
a8706c8
Let's try again
THISISDINOSAUR Nov 4, 2024
4def4ea
Remove full branch name
THISISDINOSAUR Nov 4, 2024
1d57243
Remove ref
THISISDINOSAUR Nov 4, 2024
80e666e
Change to use ref name
THISISDINOSAUR Nov 4, 2024
dba999b
Try contains
THISISDINOSAUR Nov 4, 2024
4f44724
Comment out most if lines
THISISDINOSAUR Nov 4, 2024
3a82d0d
Fix syntax error
THISISDINOSAUR Nov 4, 2024
ca9d65f
Fix additional syntax error
THISISDINOSAUR Nov 4, 2024
1edb59d
Try exact name again
THISISDINOSAUR Nov 4, 2024
3b798f2
Fix syntax error
THISISDINOSAUR Nov 4, 2024
3b9dc27
Try full ref
THISISDINOSAUR Nov 4, 2024
8b41857
Try switchiing to github.event
THISISDINOSAUR Nov 4, 2024
4933be5
Go back to ref name
THISISDINOSAUR Nov 4, 2024
fc036e1
Remove refs/heads
THISISDINOSAUR Nov 4, 2024
1c248aa
Try something that really should work no matter what
THISISDINOSAUR Nov 4, 2024
0d4bfcf
...except this time spell it right
THISISDINOSAUR Nov 4, 2024
2344356
Try inverting contains in case the docs are wrong
THISISDINOSAUR Nov 4, 2024
0408556
Add thing to help debug
THISISDINOSAUR Nov 4, 2024
87790a9
Let's see if the name is null
THISISDINOSAUR Nov 4, 2024
6328206
Rename action
THISISDINOSAUR Nov 4, 2024
ab3d83a
Try yet something else
THISISDINOSAUR Nov 4, 2024
921f36f
Try changing to more specific check
THISISDINOSAUR Nov 4, 2024
46a4707
Change contains to startWith
THISISDINOSAUR Nov 4, 2024
bbbc887
Readd file checks
THISISDINOSAUR Nov 4, 2024
acd6ddb
Add check to make sure it runs on schedule
THISISDINOSAUR Nov 4, 2024
1bfc67b
Change branch checks to use base not head
THISISDINOSAUR Nov 4, 2024
db6f8b2
Add file just to make dif
THISISDINOSAUR Nov 4, 2024
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
166 changes: 166 additions & 0 deletions .github/workflows/pir_end_to_end_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: PIR E2E Tests

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1-5' # 3AM UTC offsetted to legacy to avoid action-junit-report@v4 bug
pull_request:

jobs:
pir-e2e-tests:
name: PIR e2e tests
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [macos-14-xlarge]
include:
- xcode-version: "15.4"
runner: macos-14-xlarge

if: |
startsWith(github.event.pull_request.base.ref, 'release/') ||
startsWith(github.event.pull_request.base.ref, 'hotfix/') ||
contains(toJson(github.event.pull_request.files.*.filename), 'DBPE2ETests/') ||
contains(toJson(github.event.pull_request.files.*.filename), 'LocalPackages/DataBrokerProtection/') ||
contains(toJson(github.event.pull_request.files.*.filename), 'LocalPackages/DataBrokerProtection/') ||
contains(toJson(github.event.pull_request.files.*.filename), 'DuckDuckGoDBPBackgroundAgent/') ||
contains(toJson(github.event.pull_request.files.*.filename), 'DuckDuckGo.xcodeproj/project.pbxproj') ||
github.event_name == 'schedule'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.runner }}
cancel-in-progress: true

timeout-minutes: 120

steps:
- name: Register SSH keys for certificates repository and PIR fake broker repository access
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
${{ secrets.SSH_PRIVATE_KEY_PIR_FAKE_BROKER }}

- name: Check out the PIR fake broker code
uses: actions/checkout@v4
with:
repository: DuckDuckGo/pir-fake-broker
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_PIR_FAKE_BROKER }}
ref: loremattei/ci-integration
path: pir-fake-broker

- name: Start PIR Fake Broker
run: |
cd pir-fake-broker
cd scripts
./install-prerequisites.sh
./setup-ci.sh
cd ..
pnpm start:all &

- name: Check out the code
uses: actions/checkout@v4
with:
submodules: recursive
path: main

- name: Set up fastlane
run: |
cd main
bundle install

- name: Sync code signing assets
env:
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 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
run: |
cd main
bundle exec fastlane sync_signing_ci

- name: Download and unzip artifact
uses: actions/download-artifact@v4

- name: Set cache key hash
run: |
cd main
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache."
fi

- name: Cache SPM
if: env.cache_key_hash
uses: actions/cache@v4
with:
path: main/DerivedData/SourcePackages
key: ${{ runner.os }}-spm-${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-

- name: Select Xcode
run: |
# Override .xcode_version because 15.4 is not available on macos 13
echo "${{ matrix.xcode-version }}" > .xcode-version
sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- name: Run PIR e2e Tests
run: |
cd main
set -o pipefail && xcodebuild test \
-scheme "DBPE2ETests" \
-derivedDataPath "DerivedData" \
-configuration "CI" \
-skipPackagePluginValidation -skipMacroValidation \
ENABLE_TESTABILITY=true \
"-only-testing:DBPE2ETests" \
-retry-tests-on-failure \
| tee xcodebuild.log \
| tee pir-e2e-tests.log
env:
PRIVACYPRO_STAGING_TOKEN: ${{ secrets.PRIVACYPRO_STAGING_TOKEN }}

- name: Prepare test report
if: always()
run: |
cd main
xcbeautify --report junit --report-path . --junit-report-filename pir-e2e-tests.xml < pir-e2e-tests.log

- name: Publish tests report
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: "Test Report ${{ matrix.runner }}"
report_paths: pir-e2e-tests.xml

- name: Upload logs when workflow failed
uses: actions/upload-artifact@v4
if: failure() || cancelled()
with:
name: "BuildLogs ${{ matrix.runner }}"
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
~/Library/Logs/DiagnosticReports/*
retention-days: 7

notify-failure:
name: Notify on failure
if: ${{ always() && github.event_name == 'schedule' && (needs.pir-e2e-tests.result == 'failure' || needs.pir-e2e-tests.result == 'cancelled') }}
needs: [pir-e2e-tests]
runs-on: ubuntu-latest

steps:
- name: Create Asana task when workflow failed
uses: duckduckgo/[email protected]
with:
action: create-asana-task
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-project: ${{ vars.MACOS_APP_DEVELOPMENT_ASANA_PROJECT_ID }}
asana-task-name: GH Workflow Failure - PIR e2e Tests
asana-task-description: The PIR e2e Tests workflow has failed. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
83 changes: 56 additions & 27 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Checks

on:
push:
branches: [ main, "release/**" ]
branches: [ main, "release/**", "loremattei/**" ]
pull_request:
workflow_call:
inputs:
Expand Down Expand Up @@ -120,33 +120,56 @@ jobs:
flavor: Sandbox

runs-on: macos-14-xlarge
timeout-minutes: 30
timeout-minutes: 50

outputs:
private-api-check-report: ${{ steps.private-api.outputs.report }}
commit_author: ${{ steps.fetch_commit_author.outputs.commit_author }}

steps:
- name: Register SSH key for certificates repository access
- name: Register SSH keys for certificates repository and PIR fake broker repository access
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
${{ secrets.SSH_PRIVATE_KEY_PIR_FAKE_BROKER }}

- name: Check out the code
uses: actions/checkout@v4
with:
repository: DuckDuckGo/pir-fake-broker
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_PIR_FAKE_BROKER }}
ref: loremattei/ci-integration
path: pir-fake-broker

- name: Start PIR Fake Broker
run: |
cd pir-fake-broker
cd scripts
./install-prerequisites.sh
./setup-ci.sh
cd ..
pnpm start:all &

- name: Check out the code
if: github.event_name == 'pull_request' || github.event_name == 'push'
uses: actions/checkout@v4
with:
submodules: recursive
path: main

- name: Check out the code
if: github.event_name != 'pull_request' && github.event_name != 'push'
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.branch || github.ref_name }}
path: main

- name: Set up fastlane
run: bundle install
run: |
cd main
bundle install

- name: Sync code signing assets
env:
Expand All @@ -155,10 +178,13 @@ jobs:
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
run: bundle exec fastlane sync_signing_ci
run: |
cd main
bundle exec fastlane sync_signing_ci

- name: Set cache key hash
run: |
cd main
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
Expand All @@ -170,33 +196,35 @@ jobs:
if: env.cache_key_hash
uses: actions/cache@v4
with:
path: DerivedData/SourcePackages
path: main/DerivedData/SourcePackages
key: ${{ runner.os }}-spm-${{ matrix.cache-key }}${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-${{ matrix.cache-key }}

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- name: Build and run unit tests
run: |
echo "Runner ${RUNNER_NAME} (${RUNNER_TRACKING_ID})"
export OS_ACTIVITY_MODE=debug

set -o pipefail && xcodebuild test \
-scheme "${{ matrix.scheme }}" \
-derivedDataPath "DerivedData" \
-configuration "CI" \
-skipPackagePluginValidation -skipMacroValidation \
ENABLE_TESTABILITY=true \
ONLY_ACTIVE_ARCH=${{ matrix.active-arch }} \
"-skip-testing:${{ matrix.integration-tests-target }}" \
| tee ${{ matrix.flavor }}-unittests-xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename ${{ matrix.flavor }}-unittests.xml \
|| { mv "$(grep -m 1 '.*\.xcresult' ${{ matrix.flavor }}-unittests-xcodebuild.log | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" ./${{ matrix.flavor }}-unittests.xcresult && exit 1; }
run: cd main && sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

# - name: Build and run unit tests
# run: |
# cd main
# echo "Runner ${RUNNER_NAME} (${RUNNER_TRACKING_ID})"
# export OS_ACTIVITY_MODE=debug

# set -o pipefail && xcodebuild test \
# -scheme "${{ matrix.scheme }}" \
# -derivedDataPath "DerivedData" \
# -configuration "CI" \
# -skipPackagePluginValidation -skipMacroValidation \
# ENABLE_TESTABILITY=true \
# ONLY_ACTIVE_ARCH=${{ matrix.active-arch }} \
# "-skip-testing:${{ matrix.integration-tests-target }}" \
# | tee ${{ matrix.flavor }}-unittests-xcodebuild.log \
# | xcbeautify --report junit --report-path . --junit-report-filename ${{ matrix.flavor }}-unittests.xml \
# || { mv "$(grep -m 1 '.*\.xcresult' ${{ matrix.flavor }}-unittests-xcodebuild.log | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" ./${{ matrix.flavor }}-unittests.xcresult && exit 1; }

- name: Run integration tests
run: |
cd main
set -o pipefail && xcodebuild test \
-scheme "${{ matrix.scheme }}" \
-derivedDataPath "DerivedData" \
Expand All @@ -213,6 +241,7 @@ jobs:
- name: Check private API usage
id: private-api
run: |
cd main
if [[ ${{ matrix.flavor }} != "Sandbox" ]]; then
echo "Skipping private API usage check for ${{ matrix.flavor }} build"
else
Expand Down Expand Up @@ -277,15 +306,15 @@ jobs:

- name: Upload failed integration tests log
uses: actions/upload-artifact@v4
if: failure()
if: failure() || cancelled()
with:
name: ${{ matrix.flavor }}-integrationtests-xcodebuild.log
path: ${{ matrix.flavor }}-integrationtests-xcodebuild.log
retention-days: 7

- name: Upload failed integration tests xcresult
uses: actions/upload-artifact@v4
if: failure()
if: failure() || cancelled()
with:
name: ${{ matrix.flavor }}-integrationtests.xcresult
path: ${{ matrix.flavor }}-integrationtests.xcresult
Expand Down
21 changes: 21 additions & 0 deletions DBPE2ETests/DBPE2ETestsBridging.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// IntegrationTestsBridging.h
//
// Copyright © 2021 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "Bridging.h"

#import "WKURLSchemeTask+Private.h"
Loading
Loading