Skip to content

Conversation

@soemo
Copy link
Contributor

@soemo soemo commented Jun 10, 2025

Type of Change

  • Bugfix
  • Enhancement / new feature
  • Refactoring
  • Documentation

Description

See Slack

As we have in the frontend and studio repository different kinds of tests running in the CI, it is not so easy to find a prefix for all of them to list the failing/flaky tests on the default branch.

Therefore @ikortelainen came up with the idea to use a path suffix.

This is implemented in the PR

How to test

  • code check
  • run it locally with python3 find_flaky_tests.py --auth-token "**********" --prefix '' --path-suffixes '.spec.ts,.spec.tsx, .test.ts, .test.tsx' Staffbase/frontend master
  • or check my results / diffs with some local extra logging
> python3 find_flaky_tests.py --auth-token "**********" --prefix '' --path-suffixes '.spec.ts,.spec.tsx, .test.ts, .test.tsx' Staffbase/frontend master

AppState(auth_token='****', org='Staffbase', repo='frontend', branch='master', slack_channel=None, path_suffixes=('.spec.ts', '.spec.tsx', '.test.ts', 'test.tsx'), prefix='', since=datetime.datetime(2025, 6, 1, 12, 42, 18, 891392), until=datetime.datetime(2025, 6, 8, 12, 42, 18, 891397))

in suffixes  test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/StaticPage.ts skipping
in suffixes  test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/StaticPage.ts skipping
in suffixes  test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/page-widgets/StaticContentWidget.ts skipping
in suffixes  test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/StaticPage.ts skipping

diff for two runs with and without the suffixes

diff find_flaky_tests_frontend.txt find_flaky_tests_frontend_only_prefix.txt
11a12,28
> test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/StaticPage.ts:
>     in 5900ec067af273fcd6a7ce00d1cccb8f50551fb8 on 2025-06-06 14:57:46+00:00, see https://github.com/Staffbase/frontend/actions/runs/15511684638/job/43673445290
..
> test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/page-widgets/StaticContentWidget.ts:
>     in 5900ec067af273fcd6a7ce00d1cccb8f50551fb8 on 2025-06-06 14:57:46+00:00, see https://github.com/Staffbase/frontend/actions/runs/15511684638/job/43673445290
..
> test/e2e-playwright/tests/api/chat-api.ts:
>     in 1bb06ecaefaf9e831db186f5a387fed8131267a7 on 2025-06-06 14:57:46+00:00, see https://github.com/Staffbase/frontend/actions/runs/15490497483/job/43614695140
...
> test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/BaseGeneral.ts:
>     in 1bb06ecaefaf9e831db186f5a387fed8131267a7 on 2025-06-06 14:57:46+00:00, see https://github.com/Staffbase/frontend/actions/runs/15490118050/job/43613499968
...
> test/e2e-playwright/tests/archived-webdriver-tests/pageobjects/Dialog.page.ts:
>     in bfb4c3cdb28679094aca8552e3ed747530755dce on 2025-06-05 10:06:11+00:00, see https://github.com/Staffbase/frontend/actions/runs/15437949376/job/43448679464

TODOs after PR merge

@soemo soemo requested a review from a team as a code owner June 10, 2025 06:35
@github-actions
Copy link

github-actions bot commented Jun 10, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@soemo
Copy link
Contributor Author

soemo commented Jun 10, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jun 10, 2025
@soemo soemo requested review from a team and MarvinZeising June 10, 2025 06:38
@0x46616c6b 0x46616c6b requested a review from Copilot June 10, 2025 08:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an optional file path suffix filter to the find_flaky_tests.py script and updates the corresponding GitHub Action and documentation.

  • Adds a new path_suffixes field in AppState, CLI parsing (--path-suffixes), and filters annotations by suffix in list_occurrences.
  • Updates action.yml to expose the path-suffixes input to the GitHub Action.
  • Extends README.md with an example showing how to specify path suffixes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
find_flaky_tests.py Introduces path_suffixes parsing and filtering logic.
action.yml Defines path-suffixes input and passes it to the script.
README.md Adds path-suffixes to the usage example under inputs.
Comments suppressed due to low confidence (2)

find_flaky_tests.py:60

  • Add unit tests for parse_suffixes_tuple to verify correct parsing of comma-separated suffix strings and edge cases.
def parse_suffixes_tuple(s: str | None) -> tuple | None:

find_flaky_tests.py:236

  • Add integration tests for list_occurrences to ensure annotations are correctly filtered by the provided suffixes.
                if state.path_suffixes and not ann.path.endswith(tuple(state.path_suffixes)):

Copy link
Member

@MarvinZeising MarvinZeising left a comment

Choose a reason for hiding this comment

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

Nice, thanks!
Why not file-suffixes? Since we use it to filter the files and not the paths where those files can be found?

@soemo
Copy link
Contributor Author

soemo commented Jun 10, 2025

Nice, thanks! Why not file-suffixes? Since we use it to filter the files and not the paths where those files can be found?

I named it path because the GitHub annotation has it as path too.

@soemo soemo merged commit 769e7bc into main Jun 10, 2025
6 checks passed
@soemo soemo deleted the SP-000-add-path-suffixes branch June 10, 2025 15:36
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants