Add test for clusterConfig

This commit is contained in:
Jan Eitzinger 2024-07-03 12:11:43 +02:00
parent bd89ce7cc9
commit b05909969f
Signed by: moebiusband
GPG Key ID: 2574BA29B90D6DD5
2 changed files with 12 additions and 3 deletions

1
go.mod
View File

@ -7,6 +7,7 @@ require (
github.com/ClusterCockpit/cc-units v0.4.0 github.com/ClusterCockpit/cc-units v0.4.0
github.com/Masterminds/squirrel v1.5.3 github.com/Masterminds/squirrel v1.5.3
github.com/coreos/go-oidc/v3 v3.9.0 github.com/coreos/go-oidc/v3 v3.9.0
github.com/davecgh/go-spew v1.1.1
github.com/go-co-op/gocron v1.25.0 github.com/go-co-op/gocron v1.25.0
github.com/go-ldap/ldap/v3 v3.4.4 github.com/go-ldap/ldap/v3 v3.4.4
github.com/go-sql-driver/mysql v1.7.0 github.com/go-sql-driver/mysql v1.7.0

View File

@ -2,14 +2,22 @@
// All rights reserved. // All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package archive package archive_test
import ( import (
"encoding/json" "encoding/json"
"testing" "testing"
"github.com/ClusterCockpit/cc-backend/pkg/archive"
"github.com/davecgh/go-spew/spew"
) )
func TestClusterConfig(t *testing.T) { func TestClusterConfig(t *testing.T) {
var fsa FsArchive if err := archive.Init(json.RawMessage("{\"kind\":\"testdata/archive\"}"), false); err != nil {
version, err := fsa.Init(json.RawMessage("{\"path\":\"testdata/archive\"}")) t.Fatal(err)
}
c := archive.GetCluster("fritz")
spew.Dump(c)
t.Fail()
} }