Skip to content

Conversation

@bitwiseman
Copy link
Contributor

@bitwiseman bitwiseman commented Mar 11, 2021

This test failure made it past CI because the project uses the Java version to decide whether to enable script splitting or not. When run outside of CI, that choice is apparently not preserved.

@bitwiseman bitwiseman changed the title Try running on Java 11 with the default Jenkins version Test needs to assume script splitting is enabled Mar 11, 2021
@jglick
Copy link
Member

jglick commented Mar 11, 2021

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Fine as a hotfix if it works. I suspect the basic problem is the abuse of POM profiles to control test execution. (To start with, recall that <activation> is ignored if you explicitly pass a list of profiles on the CLI!) Basically anything “creative” in a POM is a warning sign.

If this script splitting, whatever it is, behaves differently on Java 8 vs. 11, then better to have the test code itself decide whether to run or not. Or if you have some sort of feature flag, then use FlagRule to verify behavior with nondefault settings (which ensures that the flag is reset when the test finishes), and as needed use @Parameterized or other POJO idioms to run analogous tests with the flag both on and off.

*/
@SuppressFBWarnings(value="SE_NO_SERIALVERSIONID")
class RuntimeASTTransformer {
public class RuntimeASTTransformer {
Copy link
Member

Choose a reason for hiding this comment

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

guessing you do not actually want this to be public (except for test code?) so you can change it at will?

Suggested change
public class RuntimeASTTransformer {
@Restricted(NoExternalUse.class) // for test use only
public class RuntimeASTTransformer {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtnord
Actually, no. I considered that, but Groovy that is loaded and run in pipeline has difficulty with attributes. Making this public is not great, but not horrible.

Copy link
Member

@jtnord jtnord left a comment

Choose a reason for hiding this comment

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

if it works 🤷

@bitwiseman
Copy link
Contributor Author

bitwiseman commented Jul 28, 2021

Follow on to e1ef424 . We can't sent environment variables in buildPlugin() so that change uses java version to turn on script spitting for at least one run in CI.

This skips this test if script splitting is not enabled - it requires it to work.

@bitwiseman bitwiseman marked this pull request as ready for review July 28, 2021 21:40
@bitwiseman bitwiseman merged commit 53befa0 into jenkinsci:master Jul 28, 2021
@bitwiseman bitwiseman deleted the task/pct-failure branch July 28, 2021 21:51
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