Skip to content

Conversation

@glennsarti
Copy link
Contributor

This PR adds two simple acceptance tests for the module builder. The tests
build an example Puppet Module (motd) and then installs it via Puppet. The tests
ensure that the extacted content is as expected as the source.

This commit adds a test fixture which will later be used by acceptance tests to
test whether the module builder builds modules that Puppet can extract.
@glennsarti glennsarti requested review from a team as code owners February 25, 2020 08:22
@glennsarti
Copy link
Contributor Author

Note the large file diff (+3,028) is due to the large test fixture, not that actual test suite.

@DavidS
Copy link
Contributor

DavidS commented Feb 25, 2020

You could pull in the module from github during the test to save on the lines committed. Or create a new module to reduce ballast in spec/fixtures.

This commit adds two simple acceptance tests for the module builder.  The tests
build an example Puppet Module (motd) and then installs it via Puppet. The tests
ensure that the extacted content is as expected as the source.
@glennsarti
Copy link
Contributor Author

Yeah I thought about that... decided to just vendor it in to reduce dependencies. Worst case I could just go through all the files and add single line comments instead of having "real" content"

@codecov-io
Copy link

codecov-io commented Feb 25, 2020

Codecov Report

Merging #8 into master will increase coverage by 20.51%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #8       +/-   ##
==========================================
+ Coverage   71.79%   92.3%   +20.51%     
==========================================
  Files           2       2               
  Lines         156     156               
==========================================
+ Hits          112     144       +32     
+ Misses         44      12       -32
Impacted Files Coverage Δ
lib/puppet/modulebuilder/builder.rb 92.2% <0%> (+20.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ea46e9...cd2480b. Read the comment docs.

@glennsarti
Copy link
Contributor Author

Travis:

Puppet::Modulebuilder::Builder
  with a real module that is built
    builds the module and returns the path to the tarball
    which is installed via Puppet
      expands the expected paths
Finished in 1.18 seconds (files took 0.15477 seconds to load)
2 examples, 0 failures

Appveyor:

Puppet::Modulebuilder::Builder
  with a real module that is built
    builds the module and returns the path to the tarball
    which is installed via Puppet
      expands the expected paths
Finished in 2.93 seconds (files took 0.39675 seconds to load)
2 examples, 0 failures
Coverage report generated for RSpec to C:/projects/puppet-modulebuilder/coverage. 126 / 156 LOC (80.77%) covered.

Tests are running and are green!

@DavidS DavidS added the maintenance maintenance label Feb 25, 2020
@DavidS DavidS merged commit 97815f8 into puppetlabs:master Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants