Skip to content

Integration tests: remove some duplicated code, and preserve context#38557

Merged
vdemeester merged 2 commits intomoby:masterfrom
thaJeztah:remove_duplicated_code
Jan 15, 2019
Merged

Integration tests: remove some duplicated code, and preserve context#38557
vdemeester merged 2 commits intomoby:masterfrom
thaJeztah:remove_duplicated_code

Conversation

@thaJeztah
Copy link
Member

follow-up to #38556 (this one is based on top of that)

This introduces NoTasksForService and NoTasks poller checks, that
can be used to check if no tasks are left in general, or for a specific
service.

Some redundant checks were also removed from some tests.

@thaJeztah
Copy link
Member Author

Something fishy: (also see the other PR);

01:57:05 === RUN   TestCreateServiceMultipleTimes
01:57:36 --- FAIL: TestCreateServiceMultipleTimes (31.54s)
01:57:36     daemon.go:296: [d7cd2d1029bee] waiting for daemon to start
01:57:36     daemon.go:328: [d7cd2d1029bee] daemon started
01:57:36     create_test.go:103: timeout hit after 30s: task count at 20 waiting for 4
01:57:36     daemon.go:283: [d7cd2d1029bee] exiting daemon

Logs from that daemon:

docker.log

Clean up and refactor this test;

- make `serviceRunningTasksCount` to use a `desired-state` filter
- use subtests, and inline the `validNetworkVerbose` checks; also use
  asserts for the individual checks, so that any failure will log exactly
  what failed
- remove helper functions that are no longer needed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the remove_duplicated_code branch from dbe38b7 to a00da59 Compare January 14, 2019 03:32
@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@ebc0750). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #38557   +/-   ##
=========================================
  Coverage          ?   36.66%           
=========================================
  Files             ?      608           
  Lines             ?    45173           
  Branches          ?        0           
=========================================
  Hits              ?    16562           
  Misses            ?    26330           
  Partials          ?     2281

@thaJeztah thaJeztah force-pushed the remove_duplicated_code branch from a00da59 to 15aaa03 Compare January 14, 2019 03:53
This introduces `NoTasksForService` and `NoTasks` poller checks, that
can be used to check if no tasks are left in general, or for a specific
service.

Some redundant checks were also removed from some tests.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the remove_duplicated_code branch from 15aaa03 to 56a68c1 Compare January 14, 2019 03:53
Copy link
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

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