You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. When working on the Hyperv plugin, first `cd $GOPATH/src/github.com/hashicorp/packer-plugin-hyperv`
83
-
so you can run `make dev` and easily access other files. `make dev` will build the packer-plugin-hyperv binary and install it under `$HOME/.packer.d/plugins/`.
83
+
so you can run `make dev` and easily access other files. `make dev` will build the packer-plugin-hyperv binary and install it under `$HOME/.packer.d/plugins/`.
84
84
85
-
3. Make your changes to the Hyperv plugin source. You can run `make dev` to build and install locally, and `make test` to run unit tests.
85
+
3. Make your changes to the Hyperv plugin source. You can run `make dev` to build and install locally, and `make test` to run unit tests.
86
86
Any compilation errors will be shown when the binaries are rebuilding. If you don't have `make` you can simply run `go build -o packer-plugin-hyperv` from the project root, and `mv packer-plugin-hyperv ~/.packer.d/plugins/packer-plugin-hyperv` to install the plugin.
87
87
88
88
4. After building the Hyperv plugin successfully, use the latest version of Packer to build a machine and verify your changes. In the [example folder](https://github.com/hashicorp/packer-plugin-hyperv/blob/main/example) we provide a basic template. Comment out the `packer {}` block to force Packer use the development binary installed in the previous step.
@@ -225,17 +225,19 @@ does not attempt to track the latest version for each dependency.
225
225
226
226
#### HCL2 Spec code generation
227
227
228
-
Packer relies on `go generate` to generate HCL2's bridging code. First you should install the command with `go install github.com/hashicorp/packer/cmd/mapstructure-to-hcl2`, then you generate with
228
+
Packer relies on `go generate` to generate HCL2's bridging code. First you should install the command with `go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest`, then you generate with
229
229
`go generate ./...`. This should update/create `*.hcl2spec.go` file(s).
230
230
231
231
#### Running Unit Tests
232
232
233
-
You can run tests for individual packages using commands like this:
233
+
To run unit tests, simply call
234
234
235
235
```
236
-
make test TEST=./builder/ebs/...
236
+
make test
237
237
```
238
238
239
+
from the plugin's project root.
240
+
239
241
#### Running Builder Acceptance Tests
240
242
241
243
If the Hyperv Plugin has [acceptance tests](https://en.wikipedia.org/wiki/Acceptance_testing), these probably have some requirements such as environment variables to be set for API tokens and keys. Each test should error and tell you what are missing, so those are not documented here.
@@ -252,7 +254,7 @@ resources are not accidentally destroyed or overwritten during testing.
252
254
To run the acceptance tests, invoke `make testacc`:
0 commit comments