Skip to content

Change the current architecture #36

Closed
@rtakacs

Description

@rtakacs

I think that the current architecture of the project is a bit complex for the current use case. There are too many components (os, app, device, testrunner) that make unnecessary dependencies. It would be nice if the number of the components could be reduced to eliminate dependencies and make the code clearer. I also prefer if the build and test could be well separated.

The following diagram shows a possible new architecture that logically divides the js-remote-test into a builder and a tester parts:

js-remote-test
  |
  |--- API
  |      +--- common
  |      |       +--- utils.py
  |      |       +--- paths.py
  |      |       +--- console.py
  |      |       +--- reporter.py
  |      |
  |      +--- builder
  |      |       +--- config
  |      |       |       +--- iotjs-nuttx.config
  |      |       |       +--- jerry-nuttx.config
  |      |       |
  |      |       +--- patch
  |      |       |        +--- iotjs-memstat.diff
  |      |       |        +--- libtuv-memstat.diff
  |      |       |        +--- jerry-memstat.diff
  |      |       |        +--- nuttx-7.19.diff
  |      |       |        +--- tizenrt-iotjs.diff
  |      |       |        +--- tizenrt-jerryscript.diff
  |      |       |       
  |      |       +--- targets
  |      |       |       +--- host.py
  |      |       |       +--- rpi2.py
  |      |       |       +--- stm32f4dis.py
  |      |       |       +--- artik053.py
  |      |       |
  |      |       +--- builder.py
  |      |       +--- resources.json
  |      |
  |      +--- testrunner
  |              +--- targets
  |              |        +--- communication
  |              |        |        +--- sshcom.py
  |              |        |        +--- serialcom.sh
  |              |        |
  |              |        +--- host.py
  |              |        +--- rpi2.py
  |              |        +--- stm32f4dis.py
  |              |        +--- artik053.py
  |              |
  |              +--- testrunner.py
  |              +--- skiplist.json
  |
  +--- tools
  |      +--- travis_check.py
  |      +--- check_signed_off.sh
  |      +--- check_style.sh
  |
  +--- driver.py

Builder part

The builder part would have a resources.json file that could hold information about git repositories, brach or commit, or a patch list that should be applied before the build:

{
  "nuttx": {
    "repository": "https://bitbucket.org/nuttx/nuttx.git",
    "version": "nuttx-7.19",
    "patches": ["nuttx-7.19.diff"]
  },
  "stlink": {
    "repository": "https://github.com/texane/stlink.git",
    "version": "master"
  },
  "iotjs": {
    "repository": "https://github.com/Samsung/iotjs.git",
    "version": "master",
    "patches": {
      "nuttx": ["iotjs-memstat.diff", "jerry-memstat.diff", "libtuv.diff"],
      "tizenrt": ["tizenrt-iotjs.diff"]
    }
  }
}

The targets of the builder module could build the appropriate softwares (OS, Flasher, Freya, ...) and flash the device (with the appropriate flasher).
Just a note: the config and the patches folders could be moved into the builder module because they are logically belong to that. (Currently, they are in the root folder).

Testrunner

The testrunner module is responsible for the test execution where the targets are responsible for the target specific output processing. This part was already implemented in iotjs.

In general, js-remote-test would work in two modes. The first is a standalone mode when iotjs and jerryscript should be downloaded and used for testing. The second is a submodule mode when the containing application (iotjs, jerryscript) should be used for testing (so it's unnecessary to download iotjs or jerryscript).

@glistening @hs0225 @robertsipka What do you think about this change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions