digitalocean / packer-plugin-digitalocean

Packer plugin for DigitalOcean Builder
https://developer.hashicorp.com/packer/integrations/digitalocean/digitalocean
Mozilla Public License 2.0
22 stars 13 forks source link

Fix acceptance test for data source. #103

Closed andrewsomething closed 1 year ago

andrewsomething commented 1 year ago

Working on a different issue, I found that the acceptance for the data source was failing with:

A build block with one or more sources is required for executing a build.

It seems that you can no longer run a data source on its own. It needs a full build to feed into. So I've used the minimal file builder to just put the output of the data source into a temp file.

Passes with this change:

$ make testacc TEST='-run TestAccDatasource_Basic'
?       github.com/digitalocean/packer-plugin-digitalocean      [no test files]
testing: warning: no tests to run
PASS
ok      github.com/digitalocean/packer-plugin-digitalocean/builder/digitalocean 0.016s [no tests to run]
?       github.com/digitalocean/packer-plugin-digitalocean/version      [no test files]
=== RUN   TestAccDatasource_Basic
--- PASS: TestAccDatasource_Basic (2.35s)
PASS
ok      github.com/digitalocean/packer-plugin-digitalocean/datasource/image     2.368s
testing: warning: no tests to run
PASS
ok      github.com/digitalocean/packer-plugin-digitalocean/post-processor/digitalocean-import   0.015s [no tests to run]