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(config/test): provide a non-null halconfigDirectory in HalconfigParserMocker #2172

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

dbyron-sf
Copy link
Contributor

since tests like this fail in java 17 otherwise:

> Task :halyard-config:test

AccountServiceSpec > load an existent account node FAILED
    java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:209)
        at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
        at java.base/java.nio.file.Path.of(Path.java:147)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at com.netflix.spinnaker.halyard.config.config.v1.HalconfigDirectoryStructure.getHalconfigPath(HalconfigDirectoryStructure.java:50)
        at com.netflix.spinnaker.halyard.config.config.v1.HalconfigParser.transformHalconfig(HalconfigParser.java:159)
        at com.netflix.spinnaker.halyard.config.services.v1.HalconfigParserMocker.mockHalconfigParser(HalconfigParserMocker.groovy:38)
        at com.netflix.spinnaker.halyard.config.services.v1.AccountServiceSpec.makeAccountService(AccountServiceSpec.groovy:34)
        at com.netflix.spinnaker.halyard.config.services.v1.AccountServiceSpec.load an existent account node(AccountServiceSpec.groovy:56)

See e.g. https://github.com/spinnaker/halyard/actions/runs/10112106527/job/27965430799?pr=2171.

@Autowired @Setter String halconfigDirectory;
private final String halconfigDirectory;

@Autowired
Copy link
Member

Choose a reason for hiding this comment

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

NIT: - allargs lombok instead of manual constroctor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Jul 29, 2024
@mergify mergify bot added the auto merged label Jul 29, 2024
…Structure

to pave the way for some refactoring to support java 17
as a general improvement and also to pave the way to cleanly specify a non-null
halconfigDirectory during testing.
…cture

as a general improvement and also to pave the way to cleanly specify a non-null
halconfigDirectory during testing.
…arserMocker

since tests like this fail in java 17 otherwise:

> Task :halyard-config:test

AccountServiceSpec > load an existent account node FAILED
    java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:209)
        at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
        at java.base/java.nio.file.Path.of(Path.java:147)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at com.netflix.spinnaker.halyard.config.config.v1.HalconfigDirectoryStructure.getHalconfigPath(HalconfigDirectoryStructure.java:50)
        at com.netflix.spinnaker.halyard.config.config.v1.HalconfigParser.transformHalconfig(HalconfigParser.java:159)
        at com.netflix.spinnaker.halyard.config.services.v1.HalconfigParserMocker.mockHalconfigParser(HalconfigParserMocker.groovy:38)
        at com.netflix.spinnaker.halyard.config.services.v1.AccountServiceSpec.makeAccountService(AccountServiceSpec.groovy:34)
        at com.netflix.spinnaker.halyard.config.services.v1.AccountServiceSpec.load an existent account node(AccountServiceSpec.groovy:56)
@mergify mergify bot merged commit 5812e7b into spinnaker:master Jul 29, 2024
5 checks passed
@dbyron-sf dbyron-sf deleted the config-cleanup branch July 29, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged ready to merge Approved and ready for a merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants