Giter VIP home page Giter VIP logo

Comments (4)

nanliu avatar nanliu commented on June 22, 2024

TLDR, not much value unless you use windows as an unit test platform.

See example: https://github.com/voxpupuli/puppet-archive/blob/master/spec/unit/puppet/type/archive_spec.rb#L29-L58

However be aware this basically skips the windows test on Linux. It does not have the capability to exercise the two different path (i.e. travis.ci will only test linux).

Fundamentally it comes down to the method Puppet::Util.absolute_path? (since that method only cares about what OS you are running, not that rspec-puppet is trying to simulate windows via some facts). It's been a while since I looked, but maybe puppet spec tests provide some hints on how they simulate the two different platforms.

from puppet-staging.

rgarrigue avatar rgarrigue commented on June 22, 2024

Any update on this topic ? Solution or decent workaround ?

I'm interested in a way to solve the same issue for other puppet profiles & roles. As of now, I just commented it { is_expected.to compile } but a few issues went under the radar this way.

from puppet-staging.

GrammatonKlaric avatar GrammatonKlaric commented on June 22, 2024

I have discovered that this issue only occurs if I have relationship functions for a file resource or exec resource with a creates parameter in the spec test. E.g.

is_expected.to contain_Exec('working').that_comes_before('File[C:\Windows]')
is_expected.to contain_File('C:\Windows')

or

is_expected.to contain_Exec('working').that_comes_before('Exec[fails]')
is_expected.to contain_Exec('fails').with({"creates" => 'C:\Windows\mytestfile.txt'})

The above code will throw the issue, but simply having the below code will avoid the issue:

is_expected.to contain_Exec('working')
is_expected.to contain_File('C:\Windows')

or

is_expected.to contain_Exec('working')
is_expected.to contain_Exec('no longer failing').with({"creates" => 'C:\Windows\mytestfile.txt'})

Can anyone else duplicate this? Perhaps the root cause is in the relationship functions?

from puppet-staging.

ekohl avatar ekohl commented on June 22, 2024

This module is deprecated in favor of puppet-archive and as such won't receive any more updates.

from puppet-staging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.