Commit Graph

1186 Commits

Author SHA1 Message Date
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
a2f9ea17c3 Update mocha-pod to 0.8.x
Newer mocha-pod allows to setup testfs instances at the global
level. This helps the test suite setup as it can guarantee that certain
files will always be available.
2022-09-28 10:37:40 -03:00
Balena CI
dee8680779
v14.2.6 2022-09-28 00:21:07 +00:00
Balena CI
e1b12c28fe
v14.2.5 2022-09-27 04:50:53 +00:00
Balena CI
1e84f8f59f
v14.2.4 2022-09-26 20:17:29 +00:00
Balena CI
6c1a9cadb2
v14.2.3 2022-09-26 19:24:16 +00:00
Felipe Lalanne
460659429d Update dependencies to fix NPM build
Change-type: patch
2022-09-26 15:26:48 -03:00
Balena CI
9f8929aa42
v14.2.2 2022-09-22 21:42:18 +00:00
Pagan Gazzard
47dca8604b Update to webpack 5
Change-type: patch
2022-09-22 21:07:44 +01:00
Balena CI
0e053b6706
v14.2.1 2022-09-22 20:07:29 +00:00
Balena CI
ac1fa4d491
v14.2.0 2022-09-20 17:55:22 +00:00
Felipe Lalanne
b168cc35a0 Remove mixpanel configurations
Mixpanel configurations and packages are no longer used. This removes
deadcode from the supervisor.
2022-09-20 14:22:24 -03:00
Balena CI
43bf7a504e
v14.1.3 2022-09-20 13:49:12 +00:00
Pagan Gazzard
93893093ff Update webpack dependencies to latest webpack 4.x compatible versions
Change-type: patch
2022-09-20 14:13:04 +01:00
Balena CI
a8841df5a4
v14.1.2 2022-09-20 12:57:54 +00:00
Pagan Gazzard
b3d8666997 Update husky/lint-staged dev dependencies
Change-type: patch
2022-09-20 12:52:26 +01:00
Balena CI
ade6513c66
v14.1.1 2022-09-19 21:21:53 +00:00
Thodoris Greasidis
1baf972e16 Update balena-register-device to 8.0.0
Update balena-register-device from 7.2.0 to 8.0.0

Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2022-09-19 13:41:23 -07:00
Balena CI
181be21d6e
v14.1.0 2022-09-19 20:36:48 +00:00
Pagan Gazzard
5518eb17bd Update to nodejs 16
Change-type: minor
2022-09-19 17:51:48 +01:00
Balena CI
7c6eadbb6c
v14.0.26 2022-09-19 16:37:43 +00:00
Pagan Gazzard
96418d55b5 Update @balena/lint to 6.2.0
Change-type: patch
2022-09-19 16:41:28 +01:00
Pagan Gazzard
a4c13aa2e9 Update to typescript 4.8.2
Change-type: patch
2022-09-19 16:36:17 +01:00
Balena CI
4153c179b8
v14.0.25 2022-09-15 22:32:31 +00:00
Pagan Gazzard
65e69f3a83 Update to nodejs 14
Change-type: patch
2022-09-15 22:59:40 +01:00
Balena CI
627aed295a
v14.0.24 2022-09-15 20:55:25 +00:00
Balena CI
a296700201
v14.0.23 2022-09-14 20:28:58 +00:00
Christina Ying Wang
82b4a7fe1e Modify npm scripts for Flowzone
Replace test with test:base to make sure integration tests don't run in CI.
Integration tests for the Supervisor fail when not run in container, leading
to an error-exit and cause the Flowzone CI job for Node to fail.

By returning true, the Flowzone Node CI job succeeds, and this is fine even if tests
fail because they will be caught in the Docker job anyway.

Also, combine original npm test script with test:node.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-09-14 12:22:14 -03:00
Christina Ying Wang
670b9ff563 Automate dbus lib installation depending on system
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-09-14 12:22:14 -03:00
Balena CI
86aece8d29 v14.0.22 2022-09-14 11:19:10 -04:00
Balena CI
2ec9274b78 v14.0.21 2022-09-13 16:43:37 -04:00
Balena CI
efa400c5a6 v14.0.20 2022-09-13 16:07:08 -04:00
Balena CI
39cf98243f v14.0.19 2022-09-12 08:17:51 -04:00
Pagan Gazzard
45f71b38d0 Update blinking to 0.0.5
Change-type: patch
2022-09-12 13:01:32 +01:00
Balena CI
7d2df0646e v14.0.18 2022-09-07 11:53:28 -04:00
Thodoris Greasidis
725a1c9156 Update & deduplicate pinejs-client-request to 7.3.5
Update pinejs-client-request from 7.2.1 to 7.3.5
2022-09-07 17:09:19 +03:00
Thodoris Greasidis
fadd514463 Set desired es-version for downstream modules that support it
Change-type: patch
2022-09-07 17:07:16 +03:00
Balena CI
42dd4f75ac v14.0.17 2022-09-06 21:05:01 -04:00
Balena CI
6b36ccfddf v14.0.16 2022-09-06 13:48:02 -04:00
Balena CI
ba66b10c0e v14.0.15 2022-08-24 17:33:20 -04: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
Felipe Lalanne
44f3e9ccdb Add command to spawn a development environment
For development, now doing `npm run dev` will spawn containers with the
necessary dependencies for developing and testing the supervisor.
2022-08-24 14:29:17 -04: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
Felipe Lalanne
e1e35eb83b Move the current test suite under test/legacy
We are refactoring the supervisor test suite into unit tests (for
algorithms an domain model tests) and integration
tests (for interaction with out-of-process dependencies).
This means the current test suite needs to be classified into
these two categories, and fixed whenever possible.

This commit moves the test suite under the `test/legacy` folder, this
folder should be progressively migrated and eventually removed.
Subsequent commits will begin to split these files into unit and
integration whenever possible.

Depends-on: #1996
Change-type: patch
2022-08-22 17:21:51 -04:00
Balena CI
0d42ec5698 v14.0.14 2022-08-23 00:02:38 +03:00
Felipe Lalanne
71eaa3327e Use tsconfig-paths for easier access to the source
Currently, tests only can import source code modules through relative
paths `../../`. This makes it very difficult to refactor and organize
tests in folders as the paths change.

[tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) allows to
reference the source through an alias defined in the "paths" section of
tsconfig.json
2022-08-18 12:23:31 -04:00
Felipe Lalanne
1439ee30f2 Move sinon to dev dependencies
Sinon was added to the production dependencies by mistake in a previous
build. This is a module only used for testing so this fixes that error.
2022-08-18 12:23:31 -04:00
Felipe Lalanne
274503feb3 Simplify test commands in package.json
The supervisor used to perform tests both for the transpiled code (after
tsc) and one for the typescript code (using
ts-node/register/transpile-only). There is not really a reason for this
and this added complexity to the test configuration. This used to make
testing harder, as the built code didn't include source maps, meaning
the tests did not point to the right code.

Since we want to split tests in unit and integration tests as the next
test improvement, it makes sense to simplify these commands before
adding more complexity.

Change-type: patch
2022-08-18 12:23:20 -04:00
Balena CI
d83a37e6fd v14.0.13 2022-08-03 02:59:36 +04:00