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

Rerun failing tests #14144

Merged
merged 2 commits into from
May 14, 2024
Merged

Rerun failing tests #14144

merged 2 commits into from
May 14, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented May 14, 2024

No description provided.

Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

parent/pom.xml Outdated
<!-- lets re-run the failed test one more time, just to be sure -->
<rerunFailingTestsCount>0</rerunFailingTestsCount>
<!-- lets re-run the failed test, just to be sure -->
<rerunFailingTestsCount>2</rerunFailingTestsCount>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for the record: both GH actions and ASF already do this by default (2 for unit tests and 1 for integration tests).

Copy link
Contributor Author

@gnodet gnodet May 14, 2024

Choose a reason for hiding this comment

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

@orpiske I don't see tests being rerun in the following failed builds however: https://github.com/apache/camel/actions/runs/8925211751/job/24513370969?pr=14042

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 don't think the surefire.rerunFailingTestsCount system property is used, because the plugin has a specific configuration set to 0 and the property is only used as a default.

If we want the system property to take precedence, we need to remove the line or use something like:

<rerunFailingTestsCount>${surefire.rerunFailingTestsCount}</rerunFailingTestsCount>

and eventually define it with a default value:

<properties>
  <surefire.rerunFailingTestsCount>2</surefire.rerunFailingTestsCount>
</properties>

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnodet oh, so you mean this one is overriding the property we set manually? OMG.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, it may be necessary to do the same in a few more places (and also for the failsafe plugin). I looked briefly at the code and there's a few more places where this is set.

Good catch!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gnodet oh, so you mean this one is overriding the property we set manually? OMG.

Yes, the properties used as default values for plugin configs are... defaults ;-)
So if the plugin configuration specifically sets a value, the property won't be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, it may be necessary to do the same in a few more places (and also for the failsafe plugin). I looked briefly at the code and there's a few more places where this is set.

Good catch!!!

FWIW, the rerunFailingTestsCount is not explicitely set in the failsafe plugin config, so that one is not a problem and the failsafe.rerunFailingTestsCount system property should be honored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@orpiske I don' really mind the default value, but I need the rerun to happen in GitHub. So if you prefer, I can revert the default value to 0 but keep it in the properties. Or just remove the line. It will have the same effect.
Or use a camel.surefire.rerunFailingTestsCount as we have for some other properties... but that will need to adjust all the scripts / GitHub actions.
If you're fine with the current state, I can simply merge :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnodet I am fine with the current approach ... it will be great to have this flag working! Let's go ahead and merge it.

@gnodet gnodet merged commit dacc078 into apache:main May 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants