Skip to content

[AIENG-504] added never failing tests and longest tests commands#1330

Open
sandeepbarnwal wants to merge 3 commits into
mainfrom
AIENG-504
Open

[AIENG-504] added never failing tests and longest tests commands#1330
sandeepbarnwal wants to merge 3 commits into
mainfrom
AIENG-504

Conversation

@sandeepbarnwal

@sandeepbarnwal sandeepbarnwal commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add view longest-tests command hitting GET view/longest-tests
  • Add view never-failing-tests command hitting GET view/never-failing-tests
  • Both commands support --year-week, --weeks, --from, --to, --test-path, and --limit filter options

Changes

  • smart_tests/commands/view/longest_tests.py — new command implementation
  • smart_tests/commands/view/never_failing_tests.py — new command implementation
  • smart_tests/commands/view/init.py — register both new commands in the view group
  • added unit tests

Testing

  • Tested smart-tests view longest-tests and smart-tests view never-failing-tests manually

@sandeepbarnwal sandeepbarnwal requested a review from Konboi June 17, 2026 07:10
from ...utils.typer_types import DateTimeWithTimezone, parse_datetime_with_timezone


def validate_iso_week(value: str) -> str:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Defining this method in each method is redundant, so please define a validate_iso_week method in util/typer_types.py, then import and use it.

if weeks:
params["weeks"] = str(weeks)
if from_date:
params["from"] = str(from_date)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The way from_date and to_date are parsed is different from the flaky test implementation (flaky test) , so please align it with the flaky test behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, It got updated after my PR. Let me align it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done - 5fccc39

except Exception as e:
client.print_exception_and_recover(
e,
"Warning: failed to retrieve longes running tests from server"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Warning: failed to retrieve longes running tests from server"
"Warning: failed to retrieve longest running tests from server"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done - 5fccc39

)] = None,
test_path: Annotated[str | None, typer.Option(
"--test-path",
help="Test path filter (e.g., 'com.example.MyTest')",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let’s align the test path in the help message with the flaky test implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done - 5fccc39

@sandeepbarnwal sandeepbarnwal requested a review from Konboi June 19, 2026 08:48
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.

2 participants