Commit Graph

9 Commits

Author SHA1 Message Date
pipex
827f892c13 Migrate all device config tests to integration.
This means that configuration backend tests no longer use stubs and
(mostly) avoid internal dependencies in the tests. Instead of stubs and
mock-fs, the tests use [testfs](https://github.com/balena-io-modules/mocha-pod#working-with-the-filesystem)
which allows working with a real filesystem and ensuring everything is
re-set between tests.

This is the last change needed in order to be able to merge #1971. Here is the list of changes

- [x] Migrate splash image backend tests
- [x] Migrate extlinux backend tests
- [x] Migrate config.txt backend tests
- [x] Migrate extra-uenv config tests
- [x] Migrate odmdata config tests
- [x] Migrate config utils tests
- [x] Migrate device-config tests

Change-type: patch
2022-11-14 11:12:52 -03:00
Felipe Lalanne
819e184095 Setup environment for dbus tests
Change-type: patch
2022-10-17 11:24:15 -03:00
Felipe Lalanne
f19f70d690 Migrate update-lock tests as integration tests
Update-lock tests now use the actual filesystem for testing, instead of
relying on stubs and spies.

This commit also fixes a small bug with update-lock that would cause a
`PromiseRejectionHandledWarning` when the lock callback would throw.
2022-09-28 10:37:41 -03:00
Felipe Lalanne
b81294431e Migrate compose/app and compose/app-manager tests
compose/app is run as part of the unit test suite
compose/application-manager is run as part of the integration test suite
2022-09-28 10:37:41 -03:00
Felipe Lalanne
18c2f8cec9 Migrate lib/legacy tests to integration tests
This also sets up a dbus container as part of the test environment. This
container exposes a socket that the sut container can use
2022-09-28 10:37:41 -03:00
Felipe Lalanne
4113dde45d Split compose/volume tests into unit/integration
This also needs to modify the test environment as database migrations
will look for `config.json` in the location given by the variable
`CONFIG_MOUNT_POINT`.

The volume tests now run against the actual docker engine setup via dind

Change-type: patch
2022-09-28 10:37:40 -03:00
Felipe Lalanne
e47879c284 Fix mochapodrc to reference the correct test config.json 2022-09-15 22:59:40 +01:00
Felipe Lalanne
6d004f0994 Setup docker-compose.test
This allows to run integration tests during development and on CI
with the right dependencies. There are several changes that this
involves, but the gist of it is that a test environment is setup using
`docker-compose.test.yml`. This file is loaded by `resin-ci` during the
build, and ensures that integration tests are ran after setting up all
requirements. This commit also defines a test environment command that
can be setup using `npm run test:env` in order to run tests in a local
development machine.
2022-08-24 16:07:20 -04:00
Felipe Lalanne
ba51ca5fc0 Add mocha-pod for running integration tests
This ensure that whenever integration tests are ran, they
are executed in a containerized environment.
2022-08-24 14:29:17 -04:00