Skip to content

Commit

Permalink
test: move util code into tests
Browse files Browse the repository at this point in the history
Signed-off-by: Utku Ozdemir <uoz@protonmail.com>
  • Loading branch information
utkuozdemir committed Jun 26, 2021
1 parent b92e5d5 commit ac76439
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
26 changes: 0 additions & 26 deletions cmd/query_fields_parser/main.go

This file was deleted.

17 changes: 17 additions & 0 deletions internal/exporter/util_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package exporter

import (
"fmt"
"github.com/stretchr/testify/assert"
"math"
"os"
"strings"
"testing"
)

Expand All @@ -25,3 +28,17 @@ func TestHexToDecimalError(t *testing.T) {
func almostEqual(a, b float64) bool {
return math.Abs(a-b) <= 1e-9
}

// TestParseQueryFields is ran manually
func TestParseQueryFields(t *testing.T) {
t.SkipNow()
nvidiaSmiCommand := "nvidia-smi"

qFields, err := ParseAutoQFields(nvidiaSmiCommand)
if err != nil {
fmt.Printf("error: %v\n", err)
os.Exit(1)
}
fields := QFieldSliceToStringSlice(qFields)
fmt.Printf("Fields:\n\n%s\n", strings.Join(fields, "\n"))
}

0 comments on commit ac76439

Please sign in to comment.