Skip to content

Commit

Permalink
Fix core/instance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui authored and cgalibern committed Sep 11, 2023
1 parent e44fa6d commit 900e287
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
11 changes: 4 additions & 7 deletions core/instance/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ func Test_Status_Unmarshal(t *testing.T) {
Overall: status.Down,
Provisioned: provisioned.Mixed,
UpdatedAt: time.Date(2022, time.December, 28, 11, 21, 45, 800780633, time.UTC),
Resources: []resource.Status{
{
Resources: ResourceStatuses{
"volume#1": {
ResourceID: (*resourceid.T)(nil),
Rid: "volume#1",
Label: "data2",
Log: []*resource.StatusLogEntry{
{
Expand All @@ -47,9 +46,8 @@ func Test_Status_Unmarshal(t *testing.T) {
State: provisioned.True,
},
},
{
"fs#1": {
ResourceID: (*resourceid.T)(nil),
Rid: "fs#1",
Label: "flag /dev/shm/opensvc/svc/svc2/fs#1.flag",
Status: status.Down,
Type: "fs.flag",
Expand All @@ -58,9 +56,8 @@ func Test_Status_Unmarshal(t *testing.T) {
State: provisioned.False,
},
},
{
"app#1": {
ResourceID: (*resourceid.T)(nil),
Rid: "app#1",
Label: "forking app.forking",
Log: []*resource.StatusLogEntry{
{
Expand Down
4 changes: 2 additions & 2 deletions core/instance/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Test_Monitor_Unmarshal(t *testing.T) {
LocalExpectUpdatedAt: t0,
State: MonitorStateIdle,
StateUpdatedAt: t0,
Resources: ResourceMonitorMap{
Resources: ResourceMonitors{
"fs#1": ResourceMonitor{
Restart: ResourceMonitorRestart{
Remaining: 1,
Expand All @@ -61,7 +61,7 @@ func Test_Monitor_DeepCopy(t *testing.T) {
mon1 := Monitor{
LocalExpectUpdatedAt: time.Now(),
GlobalExpectUpdatedAt: time.Now(),
Resources: ResourceMonitorMap{
Resources: ResourceMonitors{
"a": ResourceMonitor{Restart: ResourceMonitorRestart{Remaining: 1, LastAt: time.Now()}},
"b": ResourceMonitor{Restart: ResourceMonitorRestart{Remaining: 8, LastAt: time.Now()}},
},
Expand Down
13 changes: 5 additions & 8 deletions core/instance/testdata/status.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
"kind": "svc",
"provisioned": "mixed",
"updated_at": "2022-12-28T11:21:45.800780633Z",
"resources": [
{
"rid": "volume#1",
"resources": {
"volume#1": {
"label": "data2",
"log": [
{
Expand All @@ -24,8 +23,7 @@
"state": "true"
}
},
{
"rid": "fs#1",
"fs#1": {
"label": "flag /dev/shm/opensvc/svc/svc2/fs#1.flag",
"status": "down",
"type": "fs.flag",
Expand All @@ -34,8 +32,7 @@
"state": "false"
}
},
{
"rid": "app#1",
"app#1": {
"label": "forking app.forking",
"log": [
{
Expand All @@ -51,5 +48,5 @@
},
"restart": 2
}
]
}
}

0 comments on commit 900e287

Please sign in to comment.