Commit Graph

18 Commits

Author SHA1 Message Date
Darragh Bailey
31cc8aa91e Add basic vagrant package integration test (#1302)
Simple integration test for vagrant package to ensure the execution
completes successfully to allow for some refactoring to be performed.

Ensure libguestfs-tools installed to provide virt-sysprep for tests and
update docs to reflect.
2021-06-01 17:45:02 +01:00
Darragh Bailey
dbbfad2503 Generate test matrix dynamically from bats (#1303)
Extract the tests to be run and generate the matrix dynamically to avoid
needing to update the list within the workflow for each test added.
2021-06-01 17:21:15 +01:00
Darragh Bailey
9d70d261b4 Corrections to two test testing tool (#1276)
Ensure the two disk test tool is used to ensure any tweaks to the format
made to the script are exercised.
2021-05-14 19:11:33 +01:00
Darragh Bailey
4edb9a6831 Ensure git describe works during tests (#1280)
Resolve the error `fatal: No names found, cannot describe anything`
response coming out of calling git-describe due to fetch depth of 1.
2021-05-14 17:22:51 +00:00
Richard Turc
225237b125 Allow to use many disks in vagrant box for libvirt provider
Adds support for a new multi disk box format and handling to upload the
multiple disks to the storage pool.

New format is:
{
  'disks': [
    {
      'name': 'disk1.img',
      'virtual_size': 10,
      'format': 'qcow2'
    },
    {
      'name': 'disk2.img',
      'virtual_size': 15,
      'format': 'qcow2'
    },
    {
      'name': 'disk3.img',
    }
  ],
  'provider': 'libvirt',
  'format': 'qcow2'
}

It is expected to remove format from being set at the top level when
using the new format, with the assuming that qcow2 should be the default
format, and other formats should be permitted to be specified as needed.

Includes tests for handling the box images and creation of domain
volumes. Additionally includes an integration test to ensure a box with
2 disks will work as expected.

Partially fixes: #602
2021-05-08 17:04:10 +01:00
Darragh Bailey
6f608c54bf Fix coveralls reporting (#1272)
Remove nested paths for checking out alternative versions of 
dependencies as this appears to break the github action upload of 
coverage.
2021-05-08 15:51:18 +00:00
Darragh Bailey
fbf026aeaa Support testing against ruby 3.0 (#1243)
Retrieve vagrant and ruby-libvirt dependencies and modify as needed to
allow testing against ruby 3.0 until released versions support.

Use conditionals to skip steps when not needed.

Note that in order to use the locally built gem added to the cache
manually, need to disable checksums. However as all other ruby
versions will continue to use it, shouldn't be an issue as long as the
cache for ruby 3.0.0 is wiped clean before being used for anything such
as publishing.

Fixes: #1244
2021-04-07 19:41:28 +01:00
Emilio Cobos Álvarez
28d475ca29 Fix forward_ports with ruby 3.0 (#1242)
Fedora 24 has moved to ruby 3.0, which triggers an exception in 
vagrant-libvirt when installing it with vagrant provided by the distro.

This is caused by a chance in ruby 3.0 that can be applied to earlier
versions without any down sides:
https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
2021-04-06 15:20:04 +01:00
Michael Ablassmeier
97ea81d2be Use Github actions for integration tests against Vagrant-libvirt (#1091)
Allows to spin up vagrant boxes via vagrant-libvirt in CI replacing the 
need for vagrant-libvirt-qa to be executed separately before/after 
releases.

* Adds a github integration tests workflow
* Installs the needed toolset in separate groups for easier tracking
* Add Vagrantfile definitions for the first simple test cases in tests/ 
  using tinycore linux, using the installed master version these boxes 
  are spun up and destroyed via a test matrix.

Should help reduce effort for new maintainers to help with #1069
2021-03-21 12:06:52 +00:00
Darragh Bailey
28beb0c5f9 Remove flag-name due to behaviour mismatch (#1220)
It appears that the suggestion that flag-name should be set when doing
parallel builds, appears to lead to incorrect reporting by coveralls of
the overall coverage of all runs combined back onto the PR.
2021-03-13 14:56:24 +00:00
Darragh Bailey
bb2b022d3f Ensure github actions run on merge to main branch (#1207)
Remove missed debug line from unit test workflow.
2021-02-20 15:33:15 +00:00
Darragh Bailey
66d394d42e Switch from travis to github actions for unit tests (#1206)
Migrate to github actions as travis has switched to a process that will
require requesting minutes regularly for open source projects, and
current development is slow enough that this additional overhead is too
much.

Correct the generation of the line coverage following the example at
coverallsapp/github-action#29. Remove dependency on coveralls
gem as no longer needed if using the action.

Patch older versions of simplecov to contain a branch_coverage?
method to ensure working with simplecov-lcov.
2021-02-20 15:23:16 +00:00
Darragh Bailey
b657f7c709 Use github cache for docker layers (#1164)
Cache the build layers between github action builds to reduce time
required.
2020-10-27 10:09:49 +00:00
Darragh Bailey
4adc24b8e6 Ensure docker image build has history for version resolving (#1162)
With the switch to using git to resolve the version it's necessary to
ensure the history is available in the clone during the github action.

Add the `context: .` setting to work around a bug in the docker github
action. Based on docker/build-push-action#162
2020-10-27 09:55:08 +00:00
Darragh Bailey
80c81f62f4 Fix release workflow (#1157)
Ensure the release workflow will work consistently by limiting the
number of issues that are checked in addition to making use of a cache.
This should keep the requests below the API limit and overtime may be
increased should the cache be retained.

Add checks to determine the correct default branch and look to establish
if the tag that was created is reachable from this branch, using it as
the value for `commitish` to the create release action so that it
retains the `x commits since release` text and link.

In the case the workflow is re-run for a release after another release
look to pick up the next tag after this release in order to limit the
release notes from updating with additional fixes.
2020-10-23 14:22:35 +01:00
Darragh Bailey
e5c50de3c2 Limit docker image push (#1152)
Tweak workflow to skip attempting to push the docker image without
credentials additionally modify to allow the dockerhub organization to
be managed via a secret so that forked repos may push locally modified
images to their own dockerhub with a minimum of effort.

Additionally given the way github status checks works, this should allow
maintainers of this project to push the same commit to a local branch in
order to build and publish the image to the org dockerhub repository to
allow testing of the image before merging. Based on having first
reviewed and decided it was safe to allow access to any secrets.

Pushing the PR to a local branch will not result in getting a tag with the
pr<num> as the version, however this is a reasonable starting position.
2020-10-04 12:22:23 +01:00
Darragh Bailey
6a9e604e45 Support release notes generation (#1150)
Add github actions to automatically populate release notes on tag push.
This should make it easier to show what new functionality/improvements
have been added by populating the release page based on PRs and issues.
2020-10-03 20:52:31 +01:00
Darragh Bailey
d4d82d9773 Add docker image for vagrant-libvirt (#1149)
Provide a docker image that supports execution of vagrant-libvirt
provided the host system has docker and libvirt installed. This can help
side step many of the library compatibility issues experienced by users
by providing an alternative way to run the latest code should their
distribution not have a natively packaged vagrant.
2020-10-03 17:16:00 +01:00