Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Add config tests for app-rfid-llrp-inventory #54

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/snap-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: device-rfid-llrp

- name: app-rfid-llrp-inventory
channel: edge/pr-74


# use local action to test
Expand Down
27 changes: 10 additions & 17 deletions test/suites/app-rfid-llrp-inventory/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,18 @@ import (

// Deprecated
func TestEnvConfig(t *testing.T) {
utils.SetEnvConfig(t, appRfidLlrpSnap, appRfidLlrpService, defaultServicePort)
}

t.Run("change service port", func(t *testing.T) {
t.Cleanup(func() {
utils.SnapStop(t, appRfidLlrpService)
utils.SnapUnset(t, appRfidLlrpSnap, "env.service.port")
})

const newPort = "56789"

// make sure the port is available before using it
utils.RequirePortAvailable(t, newPort)
func TestAppConfig(t *testing.T) {
utils.SetAppConfig(t, appRfidLlrpSnap, appRfidLlrpService, appName, defaultServicePort)
}

utils.SnapStop(t, appRfidLlrpSnap)
utils.SnapSet(t, appRfidLlrpSnap, "env.service.port", newPort)
utils.SnapStart(t, appRfidLlrpSnap)
utils.WaitServiceOnline(t, 60, newPort)
})
func TestGlobalConfig(t *testing.T) {
// start clean
utils.SetGlobalConfig(t, appRfidLlrpSnap, appRfidLlrpService, defaultServicePort)
}

func TestAppConfig(t *testing.T) {
t.Skip("TODO")
func TestMixedConfig(t *testing.T) {
utils.SetMixedConfig(t, appRfidLlrpSnap, appRfidLlrpService, appName, defaultServicePort)
}
7 changes: 5 additions & 2 deletions test/suites/app-rfid-llrp-inventory/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (
"time"
)

const appRfidLlrpSnap = "edgex-app-rfid-llrp-inventory"
const appRfidLlrpService = "edgex-app-rfid-llrp-inventory.app-rfid-llrp-inventory"
const (
appRfidLlrpSnap = "edgex-app-rfid-llrp-inventory"
appName = "app-rfid-llrp-inventory"
appRfidLlrpService = appRfidLlrpSnap + "." + appName
)

var start = time.Now()

Expand Down