Skip to content

Commit

Permalink
Update dependencies (#73)
Browse files Browse the repository at this point in the history
* Update dependencies
* Bump matter-snap-testing to beta.4 tag
  - Refactor tests to use latest utils and new env packages
  • Loading branch information
jpm-canonical authored Aug 1, 2024
1 parent 0e19ef0 commit 02475b7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
7 changes: 4 additions & 3 deletions tests/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"
"time"

"github.com/canonical/matter-snap-testing/env"
"github.com/canonical/matter-snap-testing/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -19,13 +20,13 @@ func InstallChipTool(t *testing.T) {
// clean
utils.SnapRemove(t, chipToolSnap)

if utils.LocalServiceSnap() {
if env.SnapPath() != "" {
require.NoError(t,
utils.SnapInstallFromFile(nil, utils.LocalServiceSnapPath),
utils.SnapInstallFromFile(nil, env.SnapPath()),
)
} else {
require.NoError(t,
utils.SnapInstallFromStore(nil, chipToolSnap, utils.ServiceChannel),
utils.SnapInstallFromStore(nil, chipToolSnap, env.SnapChannel()),
)
}
t.Cleanup(func() {
Expand Down
12 changes: 7 additions & 5 deletions tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
module chip-tool-snap-tests

go 1.21.6
go 1.22.1

toolchain go1.22.5

require (
github.com/canonical/matter-snap-testing v1.0.0-beta.1
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.20.0
github.com/canonical/matter-snap-testing v1.0.0-beta.4
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.25.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/sys v0.22.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
20 changes: 10 additions & 10 deletions tests/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/canonical/matter-snap-testing v1.0.0-beta.1 h1:obxh5jYRWgCw6QNax4+aY571h+q/zcPZBOP64gwd56E=
github.com/canonical/matter-snap-testing v1.0.0-beta.1/go.mod h1:800wP9+ux8DW9Xr9QvlIdxFHlu85mqlhvlA2JO20aeQ=
github.com/canonical/matter-snap-testing v1.0.0-beta.4 h1:fbmKYeGaIFAlugDBx6ehz0U10bG+WcFSgNBo36hxBL0=
github.com/canonical/matter-snap-testing v1.0.0-beta.4/go.mod h1:gQqLfxxUD2Uo1Ua/L1uIuRhTVghAtdS54yhetTOeSIc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -9,14 +9,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
7 changes: 4 additions & 3 deletions tests/thread_tests/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"testing"
"time"

"github.com/canonical/matter-snap-testing/utils"

tests "chip-tool-snap-tests"

"github.com/canonical/matter-snap-testing/env"
"github.com/canonical/matter-snap-testing/utils"
)

func setup(t *testing.T) {
Expand All @@ -19,7 +20,7 @@ func setup(t *testing.T) {
utils.SnapRemove(t, otbrSnap)

// Install OTBR
utils.SnapInstallFromStore(t, otbrSnap, utils.ServiceChannel)
utils.SnapInstallFromStore(t, otbrSnap, env.SnapChannel())
t.Cleanup(func() {
utils.SnapRemove(t, otbrSnap)
})
Expand Down
7 changes: 4 additions & 3 deletions tests/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"
"time"

"github.com/canonical/matter-snap-testing/env"
"github.com/canonical/matter-snap-testing/utils"
)

Expand All @@ -31,7 +32,7 @@ func TestUpgrade(t *testing.T) {
utils.SnapConnect(t, chipToolSnap+":process-control", "")

// Install all clusters app
utils.SnapInstallFromStore(t, allClustersSnap, utils.ServiceChannel)
utils.SnapInstallFromStore(t, allClustersSnap, env.SnapChannel())

// Setup all clusters app
utils.SnapSet(t, allClustersSnap, "args", "--wifi")
Expand Down Expand Up @@ -61,8 +62,8 @@ func TestUpgrade(t *testing.T) {
})

t.Run("Upgrade snap", func(t *testing.T) {
if utils.LocalServiceSnap() {
utils.SnapInstallFromFile(t, utils.LocalServiceSnapPath)
if env.SnapPath() != "" {
utils.SnapInstallFromFile(t, env.SnapPath())
} else {
utils.SnapRefresh(t, chipToolSnap, "latest/edge")
}
Expand Down

0 comments on commit 02475b7

Please sign in to comment.