Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the current architecture #36

Closed
rtakacs opened this issue Oct 10, 2017 · 4 comments
Closed

Change the current architecture #36

rtakacs opened this issue Oct 10, 2017 · 4 comments

Comments

@rtakacs
Copy link
Contributor

rtakacs commented Oct 10, 2017

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?

@bzsolt
Copy link
Member

bzsolt commented Oct 11, 2017

Sounds good! Just a question: how can we switch between the standalone and submodule mode?
There will be an option to driver.py or they will be separated on different branches?

@rtakacs
Copy link
Contributor Author

rtakacs commented Oct 11, 2017

By default, the mode can be standalone, so iotjs should be downloaded by the testrunner:

$ python driver.py --target stm32f4dis --app iotjs

To use the submodule mode, you should define a path to your iotjs :

$ python driver.py --target stm32f4dis --app iotjs --app-path /home/example/iotjs

I think it is not necessary to use different branches for both standalone and submodule modes because the maintenance is easier if only one branch is used. The --app-path option can be a more general solution.

@glistening
Copy link
Contributor

@rtakacs I like this proposal! It might cover most requirements in #39.

@rtakacs
Copy link
Contributor Author

rtakacs commented Feb 13, 2018

Closing since #93 is landed.

@rtakacs rtakacs closed this as completed Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants