Comments (4)
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.
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.
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.
This module is deprecated in favor of puppet-archive and as such won't receive any more updates.
from puppet-staging.
Related Issues (20)
- Syntax error in staging_windir.rb HOT 8
- Failure to set '::staging::path' HOT 2
- Duplicate resource declaration HOT 8
- Add deprecation notice to README
- Add an opts parameter for tar HOT 2
- Deprecate this module in favour of puppet/archive HOT 4
- source_permissions in file.pp is raising a deprecation warning HOT 4
- Remove staged file after deploy HOT 1
- Variable $path not correctly scoped HOT 1
- staging extract with rename HOT 1
- Staging Deploy to take strip parameter HOT 1
- Puppet 4 support HOT 4
- staging module can create 0 length files HOT 1
- File source using https with username/password fails with certain password character sequences HOT 1
- unzip should use -o -f always or optionally HOT 2
- Ability to validate checksum and/or file size of archive HOT 1
- Release to puppet-community namespace on forge HOT 3
- Error loading staging_windir.rb HOT 7
- JSON syntax in staging_windir fact causes syntax error using Ruby 1.8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-staging.