spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

Covert java Duration to consul compatible interval string #614

Open spencergibb opened 4 years ago

spencergibb commented 4 years ago

https://golang.org/pkg/time/#ParseDuration

UkrainianCitizen commented 4 years ago

@spencergibb I could do this.

spencergibb commented 4 years ago

PRs welcome

UkrainianCitizen commented 4 years ago

I'm trying to build the project and the Maven install fails on spring-cloud-consul-core with failed test in org.springframework.cloud.consul.ConsulHealthIndicatorUpTest. Could you kindly share ideas why does this happen?

spencergibb commented 4 years ago

you must be running consul during the build. This is what I typically do first

rm -rf /tmp/consul && ./src/main/bash/local_run_consul.sh
spencergibb commented 4 years ago

That's not very friendly because you need to have a specific version and those scripts work on linux, maybe on a mac and not on windows.

spencergibb commented 4 years ago

I've opened #623 to investigate using testcontainers

UkrainianCitizen commented 4 years ago

@spencergibb Thanks! Could you elaborate, please, what do you mean by running consul? As far as I am concerned, it should be ran from local_run_consul.sh, given the comments hereabove, but the command consul doesn't exist for me(running from zsh).

spencergibb commented 4 years ago

You have to have Consul installed first right now. See Travis install Consul for what we do on Linux

UkrainianCitizen commented 4 years ago

Hi, now I am getting this with running consul.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.842 s
[INFO] Finished at: 2020-06-07T19:20:08+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project spring-cloud-consul-core: Compilation failure: Compilation failure:
[ERROR] /home/spring-cloud-consul/spring-cloud-consul-core/src/test/java/org/springframework/cloud/consul/ConsulHealthIndicatorUpTest.java:[19,17] cannot find symbol
[ERROR]   symbol:   class Test
[ERROR]   location: package org.junit
[ERROR] /home/spring-cloud-consul/spring-cloud-consul-core/src/test/java/org/springframework/cloud/consul/ConsulHealthIndicatorUpTest.java:[20,24] package org.junit.runner does not exist
spencergibb commented 4 years ago

rebase from master should fix it.