File tree Expand file tree Collapse file tree
spec/octocatalog-diff/tests/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,23 @@ def valid?
290290 expect ( result [ :from ] . builder . to_s ) . to eq ( 'OctocatalogDiff::Catalog::PuppetDB' )
291291 expect ( result [ :to ] . builder . to_s ) . to eq ( 'OctocatalogDiff::Catalog::JSON' )
292292 end
293+
294+ it 'should raise OctocatalogDiff::Errors::CatalogError if either catalog fails' do
295+ options = {
296+ to_catalog : OctocatalogDiff ::Spec . fixture_path ( 'catalogs/tiny-catalog.json' ) ,
297+ puppetdb_url : 'https://puppetdb.local' ,
298+ node : 'tiny-catalog-2-puppetdb' ,
299+ basedir : '/asdflkj/asdflkj/asldfjk' ,
300+ from_branch : 'foo' ,
301+ from_env : 'foo-env'
302+ }
303+ expect ( OctocatalogDiff ::PuppetDB ) . to receive ( :new ) { |*_arg | OctocatalogDiff ::Mocks ::PuppetDB . new }
304+ logger , logger_str = OctocatalogDiff ::Spec . setup_logger
305+ testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
306+ expect { testobj . send ( :build_catalog_parallelizer ) } . to raise_error ( OctocatalogDiff ::Errors ::CatalogError )
307+ expect ( logger_str . string ) . to match ( /Failed build_catalog for foo-env: OctocatalogDiff::Errors::FactRetrievalError/ )
308+ expect ( logger_str . string ) . to match ( /Failed build_catalog for foo-env/ )
309+ end
293310 end
294311
295312 describe '#add_parallel_result' do
You can’t perform that action at this time.
0 commit comments