canonical / edgex-snap-testing

4 stars 2 forks source link

Run tests without a config provider when testing config options #175

Closed MonicaisHer closed 1 year ago

MonicaisHer commented 1 year ago

This PR resolves #172 and introduces new functionality to enable testing of snaps without a config provider by disabling the config provider for a specific application and setting the common configuration path.

Todo:

MonicaisHer commented 1 year ago

The change made to the DisableConfigProviderServiceSnap function should only affect service snap tests and not the edgexfoundry snap test. I believe that the error invalid memory address or nil pointer dereference is unrelated to the change here.

farshidtz commented 1 year ago

@MonicaisHer this PR as a whole is making the edgexfoundry tests fail due to that error, which is a result of changes made here. The tests pass otherwise: https://github.com/canonical/edgex-snap-testing/actions/runs/4522519514/jobs/7965047703

As said, this is either because of issues in the services or tests. You verified here that you could run the services with common config. If you are confident about what you did there, then there is an issue in the tests.

MonicaisHer commented 1 year ago

@farshidtz I understand your point now. Previously, this PR had passed the edgexfoundry test locally with the dev.108 snap build from the above go mod bootstrapper PR. However, the dev.114 snap on the edge channel no longer passes the test. Please see https://github.com/canonical/edgex-snap-testing/issues/172#issuecomment-1485054624.

MonicaisHer commented 1 year ago

@farshidtz edgexfoundry test is passing again now, please see https://github.com/canonical/edgex-snap-testing/actions/runs/4555729191/jobs/8048092713#step:5:54

farshidtz commented 1 year ago

Suggestion for future work: the newly added functions DisableConfigProviderXXX don't actually disable the config provider. They just configure services to not use it and also to load common config from a file. For clarity, I'd call the action disuse rather than disable.