Commit Graph

4142 Commits

Author SHA1 Message Date
Balena CI
9e2d912fa1
v14.2.17 2022-11-01 21:47:55 +00:00
bulldozer-balena[bot]
849eee6cea
Merge pull request #2044 from balena-os/migrate-core-api-tests
Migrate core API tests to unit/integration excluding v1/v2 routes
2022-11-01 21:46:22 +00:00
Balena CI
636d623151
v14.2.16 2022-10-27 15:00:47 +00:00
bulldozer-balena[bot]
2d01123112
Merge pull request #2045 from balena-os/add_agx_orin_to_supported_fdt
config/backends: Add Jetson AGX Orin Devkit to the list of DTs that support configurable device-trees
2022-10-27 14:59:18 +00:00
Alexandru Costache
ea92fa9162 config/backends: Add Jetson AGX Orin Devkit to the list of DTs that support configurable device-tree
Change-type: patch
Signed-off-by: Alexandru Costache <alexandru@balena.io>
2022-10-26 12:35:01 +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
Balena CI
fd285b8f25
v14.2.15 2022-10-20 14:43:06 +00:00
bulldozer-balena[bot]
156aac4b02
Merge pull request #2040 from balena-os/docker-utils
Migrate some more legacy tests to integration
2022-10-20 14:41:11 +00:00
pipex
117651ab3c Update sinon 2022-10-19 20:38:34 -03:00
pipex
0befb30018 Migrate firewall tests to integration 2022-10-19 14:09:45 -03:00
pipex
fdbd4e32e3 Migrate db-format tests to integration 2022-10-19 12:07:03 -03: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
Balena CI
93ca9c05f3
v14.2.14 2022-10-19 13:35:19 +00:00
bulldozer-balena[bot]
0a423811a0
Merge pull request #2038 from balena-os/legacy-unit-tests
Migrate simple legacy tests to test/unit and test/integration
2022-10-19 13:34:07 +00:00
pipex
620bcae53a Migrate simple legacy tests to test/unit and test/integration
Change-type: patch
2022-10-18 20:36:53 -03:00
Balena CI
1185b92bb4
v14.2.13 2022-10-18 22:58:19 +00:00
bulldozer-balena[bot]
ccb04d42ce
Merge pull request #1842 from balena-os/api-code-reorganization
Move all Supervisor API related routes & code to device-api directory
2022-10-18 22:57:02 +00:00
Christina Ying Wang
463d73f8a4 Access api-key methods through device API
This makes for better black boxing of device API as a module.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
f586b7c9a8 Make dbus module side-effect free to not interfere with unit tests
When code that is unit tested is part of a file that imports modules which
depend on the dbus module, this breaks the unit test environment because there
is no system socket set up, as the unit test mocha config doesn't import fixtures.ts.

For example, if we change src/compose/utils to import device-config or api-binder, both
of those modules import lib/dbus which invokes a dbus.getBus call at the root level. This
is problematic for unit testing.

We can get around the root-level dbus.getBus call by initializing dbus only when it's first
needed. The mocked-dbus test setup code can also be removed in favor of legacy mocha
hooks, which makes the dbus stubbing in the legacy test environment more clear.
We can remove these legacy hooks when all the legacy tests are migrated to unit/integration.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
966d957465 Convert common.js to TypeScript
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
f77fcb9ac9 Move messages.ts to device-api
Messages are all related to Supervisor API

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
71b2aea0fe Use v2 router directly instead of through application manager
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
ce5bf89dfc Move /v1 routes in deviceState.router to v1.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
a2d9af2407 Move /v1 routes in apiBinder.router to v1.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
d08f25f0a3 Consolidate API middlewares, move api-keys to device-api
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
5af146ec4e Move supervisor-api.ts to device-api/index.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Balena CI
b7c497cc65
v14.2.12 2022-10-18 14:01:33 +00:00
bulldozer-balena[bot]
a3ed8dc703
Merge pull request #2034 from balena-os/device-state-tests
Migrate device-state tests to integration
2022-10-18 14:00:13 +00:00
pipex
a1e432f4fa Add build util to automatically detect arch from uname
This will help running `test:env` and `test:compose` in environments
other than `amd64`.
2022-10-17 11:32:47 -03:00
Felipe Lalanne
819e184095 Setup environment for dbus tests
Change-type: patch
2022-10-17 11:24:15 -03:00
pipex
97ec2a4151 Remove unused code from dbus module 2022-10-17 10:15:36 -03:00
pipex
4de816d1e9 Fix bug in preloading config vars 2022-10-17 10:15:36 -03:00
Balena CI
55285e9918
v14.2.11 2022-10-17 12:08:25 +00:00
bulldozer-balena[bot]
7297b74a2d
Merge pull request #2000 from balena-os/accept_more_label_chars
Allow most printable ASCII chars for service label key
2022-10-17 12:07:06 +00: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
Balena CI
eec12faa02
v14.2.10 2022-10-13 16:09:18 +00:00
bulldozer-balena[bot]
a57f02cf63
Merge pull request #2031 from balena-os/inherited-secrets
Use inherited secrets for flowzone
2022-10-13 16:08:01 +00:00
Balena CI
076d95d0d2
v14.2.9 2022-10-10 19:42:06 +00:00
bulldozer-balena[bot]
dfcaa2ecb8
Merge pull request #2035 from balena-os/parallel-start
Start state engine and API binder in parallel
2022-10-10 19:40:51 +00:00
Pagan Gazzard
080d112f3e Use inherited secrets for flowzone
Change-type: patch
2022-10-07 21:04:50 +00:00
Balena CI
ef0dcc39dc
v14.2.8 2022-10-03 20:37:37 +00:00
bulldozer-balena[bot]
6466fcbb8c
Merge pull request #2036 from balena-os/update-type-deps
Update type dependencies
2022-10-03 20:36:07 +00:00
Pagan Gazzard
0237bd7cf4 Update type dependencies
Change-type: patch
2022-10-03 14:38:42 -05:00
Felipe Lalanne
b4514631b1 Start state engine and API binder in parallel
The state engine and preloading is performed before the device gets a
chance to register, while this is desirable for preloaded apps, it
introduces a delay on registration which is known to cause issues since
the VPN is also trying to connect at the same time.

This triggers a simultaneous start of the device engine, the API binder
and the supevisor API to avoid delays.

Change-type: patch
2022-09-30 19:38:10 +00:00
Balena CI
24fafd6e9d
v14.2.7 2022-09-28 15:37:47 +00:00
bulldozer-balena[bot]
7b1c1882c0
Merge pull request #1998 from balena-os/test-refactor
Refactor (part of) the test suite into unit/integration
2022-09-28 15:36:24 +00:00
Felipe Lalanne
6ecff9d5b4 Remove blink tests
Blink tests really are testing functionality of the dependency and not
any local behavior.
2022-09-28 10:37:41 -03:00
Felipe Lalanne
209b409129 Migrate contract test to integration 2022-09-28 10:37:41 -03:00
Felipe Lalanne
1867b74bd7 Migrate config module tests to integration
This commit also changes the test:integration command to run integration
tests as different processes. This allows to avoid any test leaking into
each-other because of the use of singletons. This however has the side
effect of tests being slower, but that is a forcing function to refactor
the code.
2022-09-28 10:37:41 -03:00
Felipe Lalanne
f835db9509 Migrate legacy db test to integration folder 2022-09-28 10:37:41 -03:00