Skip to content

Commit

Permalink
Merge pull request #565 from swagatbora90/fix-log-and-metric-test
Browse files Browse the repository at this point in the history
Skip LogAndMetricis test when running on firecracker version >1.4.x
  • Loading branch information
swagatbora90 authored May 7, 2024
2 parents e145cf1 + 1f7ed55 commit 343ae84
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ func TestStartVMM(t *testing.T) {
}

func TestLogAndMetrics(t *testing.T) {
if skipLogAndMetricsTest() {
t.Skip()
}
fctesting.RequiresKVM(t)

tests := []struct {
Expand Down Expand Up @@ -480,6 +483,21 @@ func TestLogAndMetrics(t *testing.T) {
}
}

func skipLogAndMetricsTest() bool {
// Firecracker logging behavior has changed after
// https://github.com/firecracker-microvm/firecracker/pull/4047
// This includes default log level being changed from WARN to INFO
// TODO: Update this test once firecracker version is upgraded to >v1.5.0
version, err := getFirecrackerVersion()
if err != nil {
return true
}
// match version 1.4.x
pattern := `^1\.4\.\d+$`
match, _ := regexp.MatchString(pattern, version)
return !match
}

func testLogAndMetrics(t *testing.T, logLevel string) string {
const vmID = "UserSuppliedVMID"

Expand Down

0 comments on commit 343ae84

Please sign in to comment.