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

Use of Feature::Compat::Try in the test libraries #6265

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

b10n1k
Copy link
Contributor

@b10n1k b10n1k commented Mar 7, 2025

To be consinstence with the rest of the project, module in the test library have to use also try/catch block. This commit should complete the "migration" to Feature::Compat::Try wherever was applicable.

https://progress.opensuse.org/issues/176862

};
die $@ if ($@);
}
catch ($e) { die $e }
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether we should simply remove the eval/try/die completely because we just re-throw here anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can try but it can done in a different small commit later. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, doing it in a separate commit is a good idea.

@Martchus
Copy link
Contributor

Martchus commented Mar 7, 2025

There are actually two more issues to fix:

[10:46:28] t/24-worker-jobs.t ........................................ 1/? Use of uninitialized value $error in scalar chomp at /home/squamata/project/lib/OpenQA/Worker/Job.pm line 906.
Use of uninitialized value $error in scalar chomp at /home/squamata/project/lib/OpenQA/Worker/Job.pm line 906.
[10:43:15] t/ui/10-tests_overview.t ................... 12/? isElementDisplayed: stale element reference: stale element not found at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm:78 at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm line 81.

@b10n1k b10n1k force-pushed the try_t branch 2 times, most recently from 3981bd9 to f8fc831 Compare March 7, 2025 12:47
@b10n1k
Copy link
Contributor Author

b10n1k commented Mar 7, 2025

[10:43:15] t/ui/10-tests_overview.t ................... 12/? isElementDisplayed: stale element reference: stale element not found at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm:78 at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm line 81.

Funny again that I cant reproduce it locally.
the problem seems to come from some exception in the selenium which likely have a dependency in Try::Tiny.

@Martchus
Copy link
Contributor

Martchus commented Mar 7, 2025

The failure of t/ui/10-tests_overview.t is indeed unrelated to your PR. It also happened on #6266. I'll look into it.

@b10n1k
Copy link
Contributor Author

b10n1k commented Mar 7, 2025

[10:43:15] t/ui/10-tests_overview.t ................... 12/? isElementDisplayed: stale element reference: stale element not found at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm:78 at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm line 81.

Funny again that I cant reproduce it locally. the problem seems to come from some exception in the selenium which likely have a dependency in Try::Tiny.

perl-Selenium-Remote-Driver-1.49-bp156.1.1.x86_64.rpm in circleci perl-Selenium-Remote-Driver-1.49-1.7.src
on my machine

@b10n1k
Copy link
Contributor Author

b10n1k commented Mar 8, 2025

[10:43:15] t/ui/10-tests_overview.t ................... 12/? isElementDisplayed: stale element reference: stale element not found at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm:78 at /home/squamata/project/t/ui/../lib/OpenQA/SeleniumTest.pm line 81.
Funny again that I cant reproduce it locally. the problem seems to come from some exception in the selenium which likely have a dependency in Try::Tiny.

perl-Selenium-Remote-Driver-1.49-bp156.1.1.x86_64.rpm in circleci perl-Selenium-Remote-Driver-1.49-1.7.src on my machine

AFICT the problem comes from the perl version in Leap (5.26.1). I cant reproduce it on Tumbeweed with perl version5.40

@okurz
Copy link
Member

okurz commented Mar 8, 2025

@Mergifyio rebase

To be consinstence with the rest of the project, module in the test library
have to use also try/catch block. This commit should complete the "migration"
to Feature::Compat::Try wherever was applicable.

https://progress.opensuse.org/issues/176862
Copy link
Contributor

mergify bot commented Mar 8, 2025

rebase

✅ Branch has been successfully rebased

Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.00%. Comparing base (9d36fca) to head (16ba547).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6265   +/-   ##
=======================================
  Coverage   99.00%   99.00%           
=======================================
  Files         398      398           
  Lines       40037    40040    +3     
=======================================
+ Hits        39640    39643    +3     
  Misses        397      397           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mergify mergify bot merged commit 33ddb97 into os-autoinst:master Mar 8, 2025
46 checks passed
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