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 E2E tests GitHub actions #3528

Merged
merged 16 commits into from
Nov 18, 2024
Merged

Conversation

THISISDINOSAUR
Copy link
Contributor

@THISISDINOSAUR THISISDINOSAUR commented Nov 7, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1208698939169508/f
Tech Design URL:
CC:

Description:
Adds the yml file to run the new PIR e2e tests. It should trigger on:

  • PRs against release and hotfix branches
  • Nightly
  • If the new PR checkbox is ticked (See below)

Also slips in a minor change to the already merged tests to prevent a potential crash which offered less useful error messaging than if the expectation wasn't fulfilled

Optional E2E tests:

  • Run PIR E2E tests
    Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this.

Steps to test this PR:

  1. Check the yml that everything looks sensible
  2. Check that the tests pass against this PR [Note: The staging backend is currently down, which the tests are reliant on, so at the moment they fail]
  3. I've tested with a variety of setups with branches to test that trigger, but if keen you could also try making a release of hotfix branch to test against.

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

with:
repository: DuckDuckGo/pir-fake-broker
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_PIR_FAKE_BROKER }}
ref: loremattei/ci-integration
Copy link
Contributor

Choose a reason for hiding this comment

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

😅 This was a mostly a test... and I see it's now an outdated branch, so we should probably merge or rewrite and point to main.
I'll follow up in the fake broker repo to get this sorted out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah thanks for flagging, I completely forgot about this

@THISISDINOSAUR
Copy link
Contributor Author

Staging is now back up and I've managed to sort the new token, so the tests pass again 🎉

jobs:
pir-e2e-tests:
name: PIR e2e tests
runs-on: ${{ matrix.runner }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you doing this because we plan to run on multiple versions later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I left it in since I figured we might, do you think we should?

Copy link
Contributor

Choose a reason for hiding this comment

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

It may make sense to test across different platforms, but it's probably a good idea to make sure tests run reliably on the current version before adding more.

matrix:
runner: [macos-14-xlarge]
include:
- xcode-version: "15.4"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are changing this to 16, so we should check what we have in main when we merge.

@loremattei
Copy link
Contributor

@THISISDINOSAUR I left a couple of comments, but this looks good to me.

One thing that's unclear to me, though: the tests are shown green as if they passed successfully, but if I look at the test report it should one error (one test failed).

Am I missing/misunderstanding the report, or there's some issues with the reporting?

Screenshot 2024-11-15 at 18 20 45

@THISISDINOSAUR
Copy link
Contributor Author

THISISDINOSAUR commented Nov 15, 2024

Am I missing/misunderstanding the report, or there's some issues with the reporting?

Hmm, definitely something is off. It's currently set to retry tests on failure, and looks like it reports overall as green if the retry works, but then still reports the initial failure.
In terms of the GitHub action, that seems like okay behavior to me?

The fact that it's failing in the first place is more troubling.
It's possible that it's simply exceeding the timeout since macOS seems to have a lackadaisical attitude towards the NSBackgroundActivityScheduler values we set (in which case we should increase the timeout since we already set very low values there for tests ).

However, the fact that the behavior seems consistent that it only works the second time makes me think it's something to do with how we tell what values to set there. We had to use user defaults to let the login item know it's currently running integration tests, so I'm wondering if it's something there. I'll experiment and report back (assuming staging is back up again...)

if: always()
with:
check_name: "Test Report ${{ matrix.runner }}"
report_paths: pir-e2e-tests.xml
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tests report publisher action will show failures if you have tests that only passed on retry. The initial failure is reported in the JUnit XML file and recognized as failure by this reporter action.

To handle this, add an extra parameter below this line:

check_retries: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Although I think the current behavior (besides the fact that it fails in the first place) might be more desirable so we know about those initial failures

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! This makes sense to me. I didn't notice the retry.
👍

@loremattei loremattei self-requested a review November 18, 2024 15:14
@THISISDINOSAUR
Copy link
Contributor Author

Made a follow up task to see what's going on with the initial failure: https://app.asana.com/0/1203581873609357/1208788768876699/f

@THISISDINOSAUR THISISDINOSAUR merged commit cbd1a1e into main Nov 18, 2024
24 checks passed
@THISISDINOSAUR THISISDINOSAUR deleted the elle/pir-e2e-tests-github-actions branch November 18, 2024 15:26
samsymons added a commit that referenced this pull request Nov 18, 2024
* main:
  Bump version to 1.115.0 (310)
  Update skip-release check
  Update fastlane plugin to 0.11.6
  Bump ddg-apple-automation version for bugfix (#3565)
  PIR E2E tests GitHub actions (#3528)
  Update autoconsent to v11.5.0 (#3561)
  Bump version to 1.115.0 (309)
  Set marketing version to 1.115.0
  Update embedded files
  Bump plugin-ddg_apple_automation (#3564)
  Migrate release flow components to FastLane (#3563)
  VPN auth token logic update (#3562)
samsymons added a commit that referenced this pull request Nov 21, 2024
…g-error

# By Anka (5) and others
# Via GitHub (5) and Dominik Kapusta (1)
* main: (28 commits)
  Add attemptCount and maxAttempts to broker config (#3533)
  Hide continue setup cards after 1 week (#3471)
  Add expectation when checking email text field value (#3572)
  [macos] adding support for message bridge (#3558)
  Update PIR test runner (#3570)
  Add support for controlling sections visibility on HTML New Tab Page (#3551)
  Bump version to 1.115.0 (311)
  macOS 13/14 UI test compilation fix (#3569)
  macOS 13/14 UI test compilation fix (#3569)
  Fix bug where bookmarks bar prompt does not hide bar (#3553)
  Add OS version to download fail pixel (#3568)
  Remove get_tasks_in_last_internal_release (#3566)
  Bump version to 1.115.0 (310)
  Update skip-release check
  Update fastlane plugin to 0.11.6
  Bump ddg-apple-automation version for bugfix (#3565)
  PIR E2E tests GitHub actions (#3528)
  Update autoconsent to v11.5.0 (#3561)
  Bump version to 1.115.0 (309)
  Set marketing version to 1.115.0
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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.

3 participants