Skip to content

Commit 8347982

Browse files
author
Kevin Paulisse
committed
Update integration returns from CLI
1 parent 7262566 commit 8347982

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

lib/octocatalog-diff/cli.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def self.cli(argv = ARGV, logger = Logger.new(STDERR), opts = {})
116116
printer_obj = OctocatalogDiff::Cli::Printer.new(options, logger)
117117
printer_obj.printer(diffs, catalog_diff.from.compilation_dir, catalog_diff.to.compilation_dir)
118118

119-
# Return the diff object if requested (generally for testing) or otherwise return exit code
120-
return diffs if opts[:RETURN_DIFFS]
119+
# Return the resulting diff object if requested (generally for testing) or otherwise return exit code
120+
return catalog_diff if opts[:INTEGRATION]
121121
diffs.any? ? EXITCODE_SUCCESS_WITH_DIFFS : EXITCODE_SUCCESS_NO_DIFFS
122122
end
123123

@@ -169,11 +169,8 @@ def self.catalog_only(logger, options)
169169
puts to_catalog.to_json
170170
end
171171

172-
return EXITCODE_SUCCESS_NO_DIFFS unless options[:RETURN_DIFFS] # For integration testing
173-
# :nocov:
174-
dummy_catalog = OctocatalogDiff::API::V1::Catalog.new(OctocatalogDiff::Catalog.new(backend: :noop))
175-
[dummy_catalog, to_catalog]
176-
# :nocov:
172+
return { exitcode: EXITCODE_SUCCESS_NO_DIFFS, to: to_catalog } if options[:INTEGRATION] # For integration testing
173+
EXITCODE_SUCCESS_NO_DIFFS
177174
end
178175

179176
# --bootstrap-then-exit command

0 commit comments

Comments
 (0)