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

Test GithubDependencyTreeTask #543

Merged

Conversation

jpopelka
Copy link
Contributor

@jpopelka jpopelka commented Mar 2, 2018

test for #536

@jpopelka jpopelka requested a review from abs51295 March 2, 2018 15:13
@centos-ci
Copy link
Collaborator

@jpopelka Your image is available in the registry: docker pull registry.devshift.net/bayesian/cucos-worker:SNAPSHOT-PR-543

'com.google.guava:guava:20.0',
'junit:junit:4.10']
for dep in expected_direct_dependencies + expected_transitive_dependencies:
assert dep in results['dependencies']
Copy link
Contributor

Choose a reason for hiding this comment

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

Storing the results in a set would result in constant time lookup. Maybe use something like obtained_dependencies = set(results.get('dependencies', []))?

@jpopelka jpopelka force-pushed the test-github-dependency-tree branch from 46272a9 to 9c0efed Compare March 5, 2018 11:47
@centos-ci
Copy link
Collaborator

@jpopelka Your image is available in the registry: docker pull registry.devshift.net/bayesian/cucos-worker:SNAPSHOT-PR-543

expected_transitive_dependencies = {'commons-io:commons-io:2.0.1',
'com.google.guava:guava:20.0',
'junit:junit:4.10'}
assert expected_transitive_dependencies.issubset(obtained_dependencies)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think obtained dependencies should be the exact same as expected_direct_dependencies + expected_transitive_dependencies. It can look something like this:

expected_dependencies = expected_direct_dependencies.union(expected_transitive_dependencies)
assertSetEqual(obtained_dependencies, expected_dependencies)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need to test whether maven-dependency-plugin works correctly,
we just need to know whether the task runs it and the test as it is answers that sufficiently.

Copy link
Contributor

@abs51295 abs51295 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @jpopelka for writing the tests :)

@abs51295
Copy link
Contributor

abs51295 commented Mar 7, 2018

@jpopelka I have approved the changes. If you can resolve merge conflicts, I can merge it as well. Also there is a failing check for style.

@tisnik
Copy link
Member

tisnik commented Mar 7, 2018

@jpopelka good to know that the new CI job works as expected ;)

@jpopelka jpopelka force-pushed the test-github-dependency-tree branch from 9c0efed to 84023ee Compare March 7, 2018 12:00
@centos-ci
Copy link
Collaborator

@jpopelka Your image is available in the registry: docker pull registry.devshift.net/bayesian/cucos-worker:SNAPSHOT-PR-543

@abs51295 abs51295 merged commit 3a8e161 into fabric8-analytics:master Mar 7, 2018
@jpopelka jpopelka deleted the test-github-dependency-tree branch March 7, 2018 16:38
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.

4 participants