Commit Graph

16 Commits

Author SHA1 Message Date
Christina Ying Wang
f558be0a16 Create default network as config-only when services have host networking
This eliminates chances of host-Docker address collision for apps such
as the Supervisor where all services have host networking.

Closes: #2062
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-16 10:19:36 -08:00
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
Christina Ying Wang
532e75a77e Migrate API tests to unit/integration
This excludes route tests or refactoring. Also, created tests
for API middleware.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-25 19:06:39 +00:00
pipex
aa3002f909 Migrate docker-util tests
Merged docker-utils and delta tests into a single test suite. They are
now ran as part of the integration tests using the real engine.

Change-type: patch
2022-10-19 12:05:52 -03:00
pipex
620bcae53a Migrate simple legacy tests to test/unit and test/integration
Change-type: patch
2022-10-18 20:36:53 -03:00
Ken Bannister
91f93952db Allow most printable ASCII chars for service label key
Change-type: patch
Signed-off-by: Ken Bannister <kb2ma@runbox.com>
2022-10-14 20:50:25 -04: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
a4da25c1ef Disable logs globally using mocha hooks 2022-09-28 10:37:41 -03:00
Felipe Lalanne
a5a24e6462 Split compose/service tests into unit/integration 2022-09-28 10:37:41 -03:00
Felipe Lalanne
cdc9868d29 Split compose/network test in unit/integration
Integration tests are ran in the engine instead of mockerode.
2022-09-28 10:37:40 -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
7833fa1ff3 Un-skip fs-utils test 2022-09-28 10:37:40 -03:00
Pagan Gazzard
96418d55b5 Update @balena/lint to 6.2.0
Change-type: patch
2022-09-19 16:41:28 +01:00
Felipe Lalanne
3e45e9561e Fix withDefault type helper to work with boolean
`withDefault` is a type helper that allows to create a type that
defaults to a default value when trying to decode a nullish value.
That type was not correctly working with boolean types, causing `false`
values to be replaced by true. This would specifically cause issues when
parsing the target state, where a `running: false` in a service would
become a `running: true` due to the type decoding.

Change-type: patch
2022-09-13 20:08:32 +00:00
Felipe Lalanne
c1e6dadeb4 Create test/unit and test/integration folders
This sets up the new `test/unit` and `test/integration` folders
and starts classification of some of the test files.

Note that unit tests include, `fs-utils` and `system-info` tests.

While these tests interact with the filesystem, the implementation
of these modules is simple enough, and the tests are fast enough to
allow these tests to fall under the `unit` test category (according to
test/README)

Change-type: patch
2022-08-24 14:28:36 -04:00