Skip to content

Commit aa73cc5

Browse files
committed
validate minimum version of pytest
1 parent c1eac24 commit aa73cc5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.6.0 (Next)
2+
- Minimum `pytest` version increased to 8.4.0.
3+
- Validate minimum version of `pytest`.
4+
- Add forced short summary configuration to `compact` parameter functionality.
5+
16
### 1.5.2
27
- Note in Packer logs when they originate from this plugin.
38
- Promote `winrm` to officially supported communicator.

provisioner/testinfra.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ func (provisioner *Provisioner) Prepare(raws ...any) error {
138138

139139
// examine pytest stdout
140140
if len(outSlurp) > 0 {
141+
// validate minimum version 8.4.0
142+
if strings.Contains(string(outSlurp), "--force-short-summary") {
143+
log.Print("pytest version greater than or equal to 8.4.0 verified")
144+
} else {
145+
log.Print("the version of the specified pytest is lower than the minimum required version of 8.4.0")
146+
return errors.New("unsupported version of pytest specified")
147+
}
141148
// check for testinfra in stdout
142149
if strings.Contains(string(outSlurp), "testinfra") {
143150
log.Print("testinfra installation existence verified")

0 commit comments

Comments
 (0)