hammer-cli-csv icon indicating copy to clipboard operation
hammer-cli-csv copied to clipboard

Fix content-host export organizations

Open ldjebran opened this issue 7 years ago • 4 comments

Command "hammer csv content-hosts" create empty csv file (with headers only) when organization is not in the results returned by API GET organization with full_results=True, seems a limit of 20 records is enforced.

Fix related to bug: https://bugzilla.redhat.com/show_bug.cgi?id=1535565

ldjebran avatar Jan 19 '18 07:01 ldjebran

in order to have the unit tests to pass locally I had to add that uri multiple time in cassetes yml file, I am not sure if it's the way to do it , or we should record the requests an other time, but unfortunately I have no access.

dlezz@dlezz:~/projects/hammer-cli-csv$ bundle exec rake test
Debugging not enabled.
Running tests for: setup
Running tests for: resources
WARNING: There is already a VCR request matcher registered for :body_json. Overriding it.
WARNING: There is already a VCR request matcher registered for :params. Overriding it.
Run options: --seed 40158

# Running tests:

........................................................

Finished tests in 25.198509s, 2.2224 tests/s, 8.2545 assertions/s.

56 tests, 208 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for MiniTest to /home/dlezz/projects/coverage. 1762 / 3398 LOC (51.85%) covered.
[Coveralls] Outside the Travis environment, not sending data.

but on CI travis other unittests seems failing, please help encounter this situation

ldjebran avatar Jan 19 '18 17:01 ldjebran

@ldjebran Tests can be tricky to re-record. Are you able to start forklift devel VM? You can then use this to run the tests against and save the new cassettes.

https://github.com/Katello/hammer-cli-csv#tests

thomasmckay avatar Jan 19 '18 17:01 thomasmckay

@thomasmckay many thanks for your review, spent many time trying to setup the centos7 devel VM but in vain (The VM always hanging on waiting for IP address), (there is no problem ubuntu VMs eg: for example foreman production VM was installed successfully, but we we need the devel with katello)

dlezz@dlezz:~/projects/hammer-cli-csv$ bundle exec rake
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.5-compliant syntax, but you are running 2.3.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Running RuboCop...
Inspecting 69 files
.....................................................................

69 files inspected, no offenses detected
Debugging not enabled.
Running tests for: setup
Running tests for: resources
WARNING: There is already a VCR request matcher registered for :body_json. Overriding it.
WARNING: There is already a VCR request matcher registered for :params. Overriding it.
Run options: --seed 35381

# Running tests:

........................................................

Finished tests in 25.875400s, 2.1642 tests/s, 8.0385 assertions/s.

56 tests, 208 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for MiniTest to /home/dlezz/projects/coverage. 1761 / 3397 LOC (51.84%) covered.
[Coveralls] Outside the Travis environment, not sending data.

cannot figure out why the tests are passing locally and failing on Travis (on other modules that have not updated), if you have the possibility can you please check locally if the same tests are passing for you too.

ldjebran avatar Jan 23 '18 09:01 ldjebran

This PR seems OK to me, and tests pass now

@thomasmckay can you take a look and merge if appropriate?

beav avatar Jun 15 '18 16:06 beav