Skip to content

update docker service related model - #917

Merged
KostyaSha merged 5 commits into
docker-java:masterfrom
fengxx:service_spec_json_props
Dec 4, 2017
Merged

KostyaSha merged 5 commits into
docker-java:masterfrom
fengxx:service_spec_json_props

Conversation

@fengxx

@fengxx fengxx commented Sep 20, 2017 •

Copy link
Copy Markdown
Contributor

change command from String to List, see also spec
add labels and forceUpdate


This change is Reviewable

labels.put("com.docker.java.usage","test");
dockerClient.createServiceCmd(new ServiceSpec()
.withName(SERVICE_NAME)
.withName(SERVICE_NAME).withLabels(labels)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please call fluent from new line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@KostyaSha

Copy link
Copy Markdown
Member

could i postpone it until i resolve tests refactoring (atm fixing parallel execution issues)?

@KostyaSha

Copy link
Copy Markdown
Member

Btw, are you testing master code?

@fengxx
fengxx force-pushed the service_spec_json_props branch from bec651c to 145d9e5 Compare September 24, 2017 13:40
@fengxx

fengxx commented Sep 24, 2017

Copy link
Copy Markdown
Contributor Author

yes, I am testing on master code, please take your time for refactoring

@KostyaSha

Copy link
Copy Markdown
Member

please rebase

@fengxx
fengxx force-pushed the service_spec_json_props branch from e16c24c to ffb12c9 Compare September 29, 2017 13:11
@fengxx

fengxx commented Sep 29, 2017

Copy link
Copy Markdown
Contributor Author

got java.lang.Exception: Method beforeTest() should be static when running in IDE, but failsafe:integration-test is fine
I am not sure whether it is ok to set a default value, e.g. null EndpointSpec.mode will be created as VIP, set default value to VIP can help writing tests using IsEqual to compare inspect results

@KostyaSha

Copy link
Copy Markdown
Member

m... i didn't look at swarm tests after migration. What IDE do you use?

@fengxx
fengxx force-pushed the service_spec_json_props branch from ffb12c9 to 3d0b84d Compare September 29, 2017 13:25
@fengxx

fengxx commented Sep 29, 2017

Copy link
Copy Markdown
Contributor Author

IntelliJ IDEA

java.lang.Exception: Method beforeTest() should be static

	at org.junit.runners.model.FrameworkMethod.validatePublicVoid(FrameworkMethod.java:93)
	at org.junit.runners.model.FrameworkMethod.validatePublicVoidNoArg(FrameworkMethod.java:74)
	at org.junit.runners.ParentRunner.validatePublicVoidNoArgMethods(ParentRunner.java:155)
	at org.junit.runners.ParentRunner.collectInitializationErrors(ParentRunner.java:125)
	at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
	at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
	at org.junit.runners.Suite.<init>(Suite.java:112)
	at org.junit.runners.Parameterized.<init>(Parameterized.java:243)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

* a counter that triggers an update even if no relevant parameters have been changed
* a random value will work if it is incrementing.
*/
@JsonProperty("ForceUpdate")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

usually we don't define default values and using includeNonNull

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will update test case to set the value explicitly instead of relying default value

@KostyaSha

Copy link
Copy Markdown
Member

@fengxx feel free to change it, i only converted tests from testng, but they were failing even before. Not sure how to use them in travis.

@fengxx
fengxx force-pushed the service_spec_json_props branch 4 times, most recently from 5c2b9b0 to 37e4cef Compare September 30, 2017 13:29
@fengxx
fengxx force-pushed the service_spec_json_props branch from 37e4cef to 76fb8f1 Compare October 9, 2017 04:34
@KostyaSha

Copy link
Copy Markdown
Member

i thought bit more about swarm mode tests. Probably swarm init/etc should be done with DIND image and all other operations against just swarm endpoint, WDYT?

@sebastianbinder

Copy link
Copy Markdown
Contributor

Any update on this?

@KostyaSha KostyaSha closed this Dec 1, 2017
@KostyaSha KostyaSha reopened this Dec 1, 2017
add labels and forceUpdate
add PortConfig.PublishMode
change command from String to List<String>
@fengxx
fengxx force-pushed the service_spec_json_props branch from 76fb8f1 to 07c44cf Compare December 4, 2017 05:51
@fengxx

fengxx commented Dec 4, 2017

Copy link
Copy Markdown
Contributor Author

Rebase on master

@fengxx
fengxx force-pushed the service_spec_json_props branch from 07c44cf to fe8dbb6 Compare December 4, 2017 07:10
@codecov-io

codecov-io commented Dec 4, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #917 into master will decrease coverage by 1.6%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
- Coverage   61.87%   60.26%   -1.61%     
==========================================
  Files         410      421      +11     
  Lines        8159     8383     +224     
  Branches      521      538      +17     
==========================================
+ Hits         5048     5052       +4     
- Misses       2815     3035     +220     
  Partials      296      296
Impacted Files Coverage Δ
...com/github/dockerjava/api/model/ContainerSpec.java 2.63% <ø> (ø) ⬆️
...ithub/dockerjava/api/model/PortConfigProtocol.java 0% <ø> (ø) ⬆️
.../github/dockerjava/api/model/ServicePlacement.java 9.09% <0%> (-3.41%) ⬇️
...github/dockerjava/netty/exec/ListTasksCmdExec.java 0% <0%> (ø)
...va/com/github/dockerjava/api/model/TaskStatus.java 0% <0%> (ø)
...va/com/github/dockerjava/api/model/PortConfig.java 4.34% <0%> (-1.54%) ⬇️
...thub/dockerjava/core/command/ListTasksCmdImpl.java 0% <0%> (ø)
...m/github/dockerjava/api/model/GenericResource.java 0% <0%> (ø)
...ava/com/github/dockerjava/api/model/TaskState.java 0% <0%> (ø)
...a/com/github/dockerjava/api/model/ServiceSpec.java 3.84% <0%> (-0.51%) ⬇️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6941ba...fe8dbb6. Read the comment docs.

@KostyaSha KostyaSha added this to the 3.1.0 milestone Dec 4, 2017
@KostyaSha
KostyaSha merged commit e80848b into docker-java:master Dec 4, 2017
@sebastianbinder

sebastianbinder commented Dec 5, 2017 •

Copy link
Copy Markdown
Contributor

Thanks for your work @fengxx and @KostyaSha! Really appreciate it being able to use services now. I just opened #958 regarding some services issues. Maybe one of you guys has an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants