Skip to content

Commit

Permalink
Add a transitive test property
Browse files Browse the repository at this point in the history
This is a minimal reproducer that's essentially A ~> B ~> C. The
that_subscribes_to matcher shows that this is equal to A ~> C but in
practice Puppet doesn't work that way. The service is not restarted if
the file is modified.

I don't know what is the expected behavior here, but it does mean that
today it's not possible to test for real world behavior.
  • Loading branch information
ekohl committed Mar 15, 2021
1 parent b8b1412 commit 760bcd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/classes/relationship__notify_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@

it { should contain_notify('pre').that_notifies(['Notify[post]']) }
it { should contain_notify('post').that_subscribes_to(['Notify[pre]']) }

# TODO: in practice this transitive notification doesn't work
it { should contain_service('myservice').that_subscribes_to('File[/tmp/file.txt]') }
end
4 changes: 4 additions & 0 deletions spec/fixtures/modules/relationships/manifests/notify.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
class { '::relationships::notify::pre': } ~>
class { '::relationships::notify::middle': } ~>
class { '::relationships::notify::post': }

file { '/tmp/file.txt': } ~>
file { '/tmp/directory': } ~>
service { 'myservice': }
}

class relationships::notify::pre {
Expand Down

0 comments on commit 760bcd3

Please sign in to comment.