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

Fix broken CI/CD pipeline #1930

Closed
5 tasks done
remkop opened this issue Jan 23, 2023 · 2 comments
Closed
5 tasks done

Fix broken CI/CD pipeline #1930

remkop opened this issue Jan 23, 2023 · 2 comments
Labels
theme: build An issue or change related to the build system type: bug 🐛
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Jan 23, 2023

Fix broken tests:

  • a recent change used a Java 1.7+ API which results in broken tests when running on Java 1.6 or earlier:
:compileJava/home/runner/work/picocli/picocli/src/main/java/picocli/CommandLine.java:11634:
 <T>emptyEnumeration() is not public in java.util.Collections; 
cannot be accessed from outside package

The solution is to use Collections.enumeration(Collections.emptyList()) instead.

  • Broken tests using System.setSecurityManager on Java 18-ea -> does not manifest on Java GA, separate ticket System-Rules based tests migration #1932

  • ManPageGeneratorTest has 3 failing tests (testEndOfOptionsWithoutOptions - line 307, testNamelessCommand line 489 and testHiddenOptions line 242), likely related to Update option rendering (fixes #1886) #1896

  • Java 10 on Ubuntu fails the build due to a problem in release-tasks.gradle:

> startup failed:
  script '/home/runner/work/picocli/picocli/gradle/release-tasks.gradle': 1: 
  Can't have an abstract method in a non-abstract class. 
  The class '_BuildScript_' must be declared abstract or the method 
  'void init(java.lang.Object, org.gradle.internal.service.ServiceRegistry)' must be implemented.
   @ line 1, column 1.
     task bumpReadmeVersion {

This may be caused by this change in gradle/wrapper/gradle-wrapper.properties, which bumped Gradle from 7.4 to 7.6...

Temporary fix is to revert to Gradle 7.4.

  • Flaky tests? Broken tests on Java 10 ubuntu:
picocli.HelpAnsiTest > testUsageMainCommand_ANSI FAILED
    org.junit.ComparisonFailure at HelpAnsiTest.java:442
stty: /dev/tty: No such device or address

picocli.HelpTest > testMapFieldHelp_with_unlimitedSplit FAILED
    org.junit.ComparisonFailure at HelpTest.java:2926

2327 tests completed, 2 failed, 27 skipped

Solution: skip non-LTS versions of Java

@remkop remkop added type: bug 🐛 theme: build An issue or change related to the build system labels Jan 23, 2023
@remkop remkop added this to the 4.7.1 milestone Jan 23, 2023
remkop added a commit that referenced this issue Jan 24, 2023
Groovy asm gives unsupported class version for Gradle on java 20
remkop added a commit that referenced this issue Jan 24, 2023
Unsupported class file major version 63
  	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:199)
remkop added a commit that referenced this issue Jan 24, 2023
remkop added a commit that referenced this issue Jan 24, 2023
remkop added a commit that referenced this issue Jan 24, 2023
remkop added a commit that referenced this issue Jan 24, 2023
Error when evaluating 'runs-on' for job 'build-java-8-plus'. .github/workflows/ci.yml (Line: 32, Col: 14): Unexpected type of value '', expected type: OneOf.
remkop added a commit that referenced this issue Jan 24, 2023
remkop added a commit that referenced this issue Jan 24, 2023
@remkop remkop changed the title Fix broken CI/CD Fix broken CI/CD pipeline Jan 25, 2023
MikeTheSnowman added a commit to fortify-ps/picocli that referenced this issue Jan 27, 2023
@MikeTheSnowman
Copy link
Contributor

MikeTheSnowman commented Jan 27, 2023

@remkop , In regards to the chanes made to ManPageGenerator from PR #1896, I'm currently looking at the three failed tests in ManPageGeneratorTest and I have a few questions/comments for you so that I can update the tests appropriately.

Test testEndOfOptionsWithoutOptions:

This test expects that if a command has no options, then the "options" section in the ascii doc will still get generated. Now that PR #1896 has been merged, do you still want an empty "options" section in the ascii docs to be generated, or would you like for the test to be updated to expect for that section to be missing?

For reference, here's a screenshot showing a diff of the expected ascii doc vs the ascii doc that got generated:
image

Tests testNamelessCommand and testHiddenOptions:

These tests are failing simply because of an extra white space in various locations or newlines that get added. Not sure if this behavior is acceptable, but I looks harmeless to me, so I'll just update the test cases to accept the extra new lines and white spaces. Based on the updates in #1896, it's not immediately obvious to me why this is now happening. Here's a screenshot of the diffs for reference.

Diff from testNamelessCommand failed test outputs. This one is when compairing main_class.adoc:
image

Diff from testHiddenOptions failed test output:
image

To try and not hold you up, I've raised PR with updated test that just accept the whatever the newly generated stuff in the ascii docs. Please see PR #1940.

remkop pushed a commit that referenced this issue Jan 27, 2023
@remkop
Copy link
Owner Author

remkop commented Jan 27, 2023

@wtfacoconut Thank you for the PR! Looks good and it is merged. Many thanks!

@remkop remkop closed this as completed Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: build An issue or change related to the build system type: bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants