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

Fix broken tests for release 0.25.0 #365

Merged
merged 2 commits into from
Mar 29, 2019

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Mar 28, 2019

Release branch is fragile, only specific tests are able to run, or even CPT behavior could change during the tests.

Since release/* is a pattern for stable branch, many tests will fail when the channel is no specific the and CI manager is not mocked. Otherwise, CPT will recognize the current branch as stable and will change all package channel names during the tests.

About the package with the "name" only. It was because we use ConanAPIMock, and it only returns the package name, which represents conan_api.create returns. A typical return is:

{'recipe': {'id': 'foo/0.1@uilianries/testing', 'downloaded': False, 'exported': True, 'error': None, 'remote': None, 'time': datetime.datetime(2019, 3, 28, 19, 34, 35, 868478), 'dependency': False, 'name': 'foo', 'version': '0.1', 'user': 'uilianries', 'channel': 'testing'}, 'packages': [{'id': 'b6c337ae40a7acc0472113db7b56e3585b936000', 'downloaded': False, 'exported': False, 'error': None, 'remote': None, 'time': datetime.datetime(2019, 3, 28, 19, 34, 38, 524986), 'built': True, 'cpp_info': {'includedirs': ['include'], 'libdirs': ['lib'], 'resdirs': ['res'], 'bindirs': ['bin'], 'builddirs': [''], 'libs': ['hello'], 'rootpath': '/home/uilian/.conan/data/foo/0.1/uilianries/testing/package/b6c337ae40a7acc0472113db7b56e3585b936000', 'version': '0.1', 'description': '<Description of Foo here>', 'filter_empty': True}}]}

But since we don't to use all those fields, I only updated the reference and built.

Changelog: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.

- Release branch is fragile, only specific tests are able to run,
  or even CPT behavior could change during the tests.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
- Do not require Bintray account to run docker tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Member Author

Docker tests are exotic, they require a Bintray login and only run when it's a stable branch. The latest commit changes this behavior, the idea is run a conan_server and remove all external dependencies (bintray, pypi, ...)

@codecov-io
Copy link

codecov-io commented Mar 29, 2019

Codecov Report

❗ No coverage uploaded for pull request base (release/0.25.0@0af8d9c). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/0.25.0     #365   +/-   ##
=================================================
  Coverage                  ?   92.45%           
=================================================
  Files                     ?       32           
  Lines                     ?     3010           
  Branches                  ?        0           
=================================================
  Hits                      ?     2783           
  Misses                    ?      227           
  Partials                  ?        0
Impacted Files Coverage Δ
cpt/test/integration/base.py 100% <ø> (ø)
cpt/test/integration/docker_test.py 86.84% <100%> (ø)
cpt/packager.py 86.86% <100%> (ø)
cpt/test/unit/utils.py 96.42% <100%> (ø)
cpt/runner.py 90.81% <100%> (ø)
cpt/test/test_client/upload_checks_test.py 100% <100%> (ø)

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 0af8d9c...a3b8074. Read the comment docs.

@uilianries
Copy link
Member Author

All green again! 💚

def setUp(self):
super(DockerTest, self).setUp()
self.server_process = subprocess.Popen("conan_server")
time.sleep(3)
Copy link
Member Author

Choose a reason for hiding this comment

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

the good, the bad, and the time.sleep

@lasote
Copy link
Contributor

lasote commented Mar 29, 2019

I'm not sure about the docker test. But I'm merging and trying in the release branch. Thanks for the effort!

@lasote lasote merged commit 58e142d into conan-io:release/0.25.0 Mar 29, 2019
lasote added a commit that referenced this pull request Mar 29, 2019
* allow passing user-specified Docker args during create step

* rename parameter

* mention CONAN_DOCKER_RUN_OPTIONS envvar in readme

* add tests

* #343 Improve docker integration test

- Fix conan_pip_package. It should be a str by default
- Pass original printer to be re-used by Docker runner
- Add integration test to validate docker run options

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #343 Fix skip test when running docker

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add GitHub settings (#345) (#349)

* Add GitHub settings

- Use standard Conan tags for issues
- Add stale config for timeout bot
- Add issue template

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Use Github settings from conanio/docs

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #345 Add PR template

- Add PR template to generate the changelog
- Add the contributing guide

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Trigger Github Settings (#352)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #336 Forward login method (#344)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Upload package dependencies (#334)

* #237 Update README

- Add description about the new feature

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Upload all dependencies

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Unit test to upload all deps

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Fix env var name

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Fix upload dependencies

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Upload only built packages

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #237 Only upload when package is available

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Accept custom pip command (#347)

* #147 Support custom PIP command

- Add env var CONAN_PIP_COMMAND which allows to run a specific
  pip version, or even a pip binary path.

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #147 Check pip command before to run

- To avoid command injection, the custom pip command will be checked

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #147 Test dynamic pip version

- Check for current pip version before to customize CONAN_PIP_COMMAND

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #147 Ignore which pip on Windows

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #147 pip install quiet mode

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #147 Try to fix Windows tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #277 Accept Docker arguments as list

- both string and list are accepted as docker arguments
- Update docker test to use list

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #277 Fix options when downloading docker image

- Docker is executed in two cases. The first one is when
  we need to download the docker image and patch with the
  newest Conan version. The options were skipped there

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #354 Add CONAN_CONANFILE option (#357)

* #354 Add CONAN_CONANFILE option

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #354 Add option description on README

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #354 Support CONAN_CONANFILE option

- Add full support for custom conanfile name
- Add tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #354 Fix boolean option

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #355 Skip check credentials is boolean (#356)

- Parse the env var CONAN_SKIP_CHECK_CREDENTIALS as boolean

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* fix azure pipelines branch detection (#346)

use variable BUILD_SOURCEBRANCH
BUILD_SOURCEBRANCHNAME only has the part after last /

* Feature/upload only recipe (#348)

* #153 Upload only the recipe

- Add CONAN_UPLOAD_ONLY_RECIPE env var, which set to skip
  all binary packages upload.

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #153 Test upload only the recipe

- get boolean value from environment variable is non-case sensitive now

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #153 Fix upload recipe argument

@madebr found a bug where the argument is wrong.

Co-Authored-By: uilianries <uilianries@gmail.com>

* #153 Fix unit test for upload recipe

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #153 Add test to check parameters

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #153 Fix conflict in README file

* Update Docker run example

- Use custom Docker network instead of using custom cache.

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Prepared for 1.15

* 0.25.0

* 1.15.0

* Fix Tox version (#364)

- Tox 3.8.1 is totally broken

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #361 Upload package with revisions (#363)

* #361 Upload package with revisions

- Package reference passed to be created is not the same
  retrieved from package id when the package is built.
  "foo/0.1@bar/testing" != "foo/0.1@bar/testing#<hash>"

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #361 Parse revision

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Fix broken tests for release 0.25.0 (#365)

* Fix broken tests for release 0.25.0

- Release branch is fragile, only specific tests are able to run,
  or even CPT behavior could change during the tests.

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Run Docker test as regular test

- Do not require Bintray account to run docker tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Clean some stuff and improve test running in local
@uilianries
Copy link
Member Author

I'm not sure about the docker test

It will increase more time in our CI time, but I don't like to discover an error only when the release branch is created.

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.

3 participants