Skip to content

Initial testify work#10610

Closed
unclejack wants to merge 2 commits intomoby:masterfrom
unclejack:initial_testify_work
Closed

Initial testify work#10610
unclejack wants to merge 2 commits intomoby:masterfrom
unclejack:initial_testify_work

Conversation

@unclejack
Copy link
Copy Markdown
Contributor

This PR vendors stretchr/testify and makes api_containers integration cli tests use it.

There's a large number of tests. They need to be converted to testify in batches.

Right now, this is WIP. This PR should at least convert all api integration cli tests after agreeing on the parts of stretchr/testify we want to use (assert vs if conditions, other refactoring work).

@unclejack
Copy link
Copy Markdown
Contributor Author

ping @tianon @LK4D4 @tiborvass @icecrime

@tiborvass
Copy link
Copy Markdown
Contributor

Thanks @unclejack !

Pinging testify lovers @aluzzardi @vieux: what do you think is the right tradeoff between asserts and ifs (e.g. unclejack@9f10d27#diff-ca97ecb464e792b1086fca2ee8af23f8R39)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I love this, can we also remove all images, except scratch, busybox and third which I can't remember. And all dangling too.

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Feb 6, 2015

I am +1 to use all packages of testify if that will be more convenient then current situation. Also probably multiple suites makes sense, for example for daemon tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mispell?

@icecrime
Copy link
Copy Markdown
Contributor

icecrime commented Feb 7, 2015

So I started looking a bit at testify to see what it does, and I feel it is very wrong and wouldn't use it for Docker as it is. I submitted stretchr/testify#128 to fix this kind of unexpected behavior:

  • assert.Equal(t, 2.2, 2) == true and assert.Equal(t, 2, 2.2) == false
  • assert.Equal(t, 'x', "x") == true and assert.Equal(t, "x", 'x') == false

So it's mostly NOT LGTM for me unless we get these fixed.

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Feb 7, 2015

@aluzzardi ^^

@unclejack
Copy link
Copy Markdown
Contributor Author

@icecrime That's OK, we can avoid using assert right now and do that later.

Being able to use the suites to have setup and teardown for the tests is extremely useful.

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Feb 10, 2015

This is labelled as "design review" but I don't seen any changes to UI or public API. What am I missing?

@jessfraz
Copy link
Copy Markdown
Contributor

Well I wasn't sure if deciding if we want to use testify counts as "design review" or "code review"

@tiborvass
Copy link
Copy Markdown
Contributor

Sorry @unclejack, I'm closing this until we can agree on whether or not to use testify. I'm personally +1 for this, and would love to use both the test suites as well as the assert functions. If there are some weirdnesses that still need to be fixed on it, let's get those PRs merged upstream.

Please continue discussion below.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants