Closed farshidtz closed 2 years ago
I also noticed DEFAULT_TEST_CHANNEL=${DEFAULT_TEST_CHANNEL:-beta}
in some test scripts. I didn't remove because it maybe needed by checkbox-edgexfoundry snap when default is not set.
sudo DEFAULT_TEST_CHANNEL="latest/edge" ./run-all-tests-locally.sh -t test-refresh-services.sh
testing snap from channel: latest/edge
running single test: test-refresh-services.sh ... FAILED:
snap "edgexfoundry" is not installed
Installing snap from channel
edgexfoundry (2.0/stable) 2.0.0-4 from Canonical* installed
Installed edgexfoundry 2.0.0-4 3328 2.0/stable canonical* -
waiting for all services to come online. Current retry count: 0/300
waiting for all services to come online. Current retry count: 1/300
waiting for all services to come online. Current retry count: 2/300
all services up
error: cannot install snap file: cannot refresh "edgexfoundry" to new revision
3520 with epoch 6, because it can't read the current epoch of 5
Yes, I get the same result as @MonicaisHer - I think it's perhaps because run-all-tests-locally downloads the latest snap from the specified channel. We can't refresh directly to that, as we first need to refresh to the bridge snap, so
snap refresh edgexfoundry --channel=latest/edge
would work but
snap_download_and_ack edgexfoundry --channel=latest/edge
snap install edgexfoundry_.snap --devmode
would not.
So we need really to update run-all-tests-locally to not download the snap if a channel is specified.
changing line 104 from
REVISION_TO_TEST=$(snap_download_and_ack edgexfoundry --channel=$EDGEX_LATEST_CHANNEL)
to
REVISION_TO_TEST=""
might do it?
Thanks. Good catch.
I initially tested only with DEFAULT_TEST_CHANNEL=2.1/latest
and didn't getting any error.
This makes it possible to override the default channel when running tests locally. It was already possible via the checkbox-edgexfoundry snap.
This is useful for testing edge or branches.