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

Commit

Permalink
Add config testing for device-modbus (#55)
Browse files Browse the repository at this point in the history
* Add config testing for device-modbus

* Add snap channel for ci testing
  • Loading branch information
farshidtz authored Apr 25, 2022
1 parent 5d1ce60 commit a481b76
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/snap-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- name: device-snmp

- name: device-modbus
channel: edge/pr-336

- name: edgexfoundry

Expand Down
15 changes: 11 additions & 4 deletions test/suites/device-modbus/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ import (

// Deprecated
func TestEnvConfig(t *testing.T) {
t.Run("change service port", func(t *testing.T) {
utils.TestEnvChangeServicePort(t, deviceModbusSnap, defaultServicePort)
})
utils.SetEnvConfig(t, deviceModbusSnap, deviceModbusService, defaultServicePort)
}

func TestAppConfig(t *testing.T) {
t.Skip("TODO")
utils.SetAppConfig(t, deviceModbusSnap, deviceModbusService, deviceModbusApp, defaultServicePort)
}

func TestGlobalConfig(t *testing.T) {
// start clean
utils.SetGlobalConfig(t, deviceModbusSnap, deviceModbusService, defaultServicePort)
}

func TestMixedConfig(t *testing.T) {
utils.SetMixedConfig(t, deviceModbusSnap, deviceModbusService, deviceModbusApp, defaultServicePort)
}
7 changes: 5 additions & 2 deletions test/suites/device-modbus/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (
"time"
)

const deviceModbusSnap = "edgex-device-modbus"
const deviceModbusService = "edgex-device-modbus.device-modbus"
const (
deviceModbusSnap = "edgex-device-modbus"
deviceModbusApp = "device-modbus"
deviceModbusService = "edgex-device-modbus." + deviceModbusApp
)

var start = time.Now()

Expand Down

0 comments on commit a481b76

Please sign in to comment.