Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
About this service
DTV System (Dasharo Transparent Validation) was designed to automatically generate various charts and reports based on submitted regression tests data. There are several entities that can be defined:
Service structure
Frontend (Dashboard) [two sections]
- RTR Table - Regression Tests Results are represented as a table,
- RTR Charts - Regression Tests Results are represented as a chart,
Each sections have a simple wizard for structuring direct link to API for a specified table/chart with additional parameters (such as
format[output],title,widthetc).
Backend (API) [4 internal & 1 external endpoints]
Internal endpoints:
/clients/platforms/tests/results
External endpoint:
/<API-KEY>/<PLATFORM>/<FW-TYPE>/<VERSIONS>/<REPORT/CHART>?<OPTIONAL_PARAMETERS>
<OPTIONAL_PARAMETERS>
/chart
?format=<[HTML, IMAGE, RAW]>- generate a chart in the selected form?format=html- iframe with the chart in the form of html canvas?format=image- PNG with the chart (can be embedded as img)?format=raw- html canvas with graph (used for iframe)
?debug=true- returns information loaded from a database as JSON (should be used without the format parameter)?width=<NUM>- width in pixels (affects html and image)?height=<NUM>- same as above?test="<TEST_SIGNATURE>"- retrieves information from the database regarding the results for the selected version. Example:?test="FCD1.0"
/report
?format=<[HTML, PLAIN, RAW]>- generate table in the selected form?format=html- iframe with table in html form?format=plain- preview the table source in the form of text?format=raw- generated table (used for iframes)
?debug=true- returns information loaded from the database as JSON (use without the parameter format)?width=<NUM>- width in pixels (affects html)?height=<NUM>- same as above?test="<TEST_SIGNATURE>"- retrieves information from the database regarding the results for the selected version. Example:?test="FCD1.0"
Database Objects
- Client - this object the Client's details like
name,apiKey, andsecretKey. - Platform - one Client can have many Platform, but a single Platform can
only belong to one Client. This model contains fields like
name,firmwareType,latestVersion, andClient(OID). - Test - one Platform can have many Tests, but a single Test can only belong
to one Platform. This model contains fields like
signature,type, andplatform(OID). - Result - one Test can have many Results (with different
versionstring, but a single Result can only belong to one Test. This model are made of fields likeversion,status,issueUrl, andtest(OID).
Instructions on how to connect directly to a deployed DB are contained within connecting-db-compass-gui.md document.
Additionally, there's an instruction on how to get all necessary OID's (ObjectID used as PK in MongoDB) called adding-tests-results-using-api.md.
Deploy locally
Using docker-compose
REGUIREMENTS:
docker,docker-compose,DB with data/sample data.
- Clone service's repository.
- In
/copy.env_samplefile and name it.env. Next replace every<...>with adequate data.- Do the same to
/frontend/.env_sample. - If no DB instance is available, go to
/deploy/database, rundocker-compose up, and modify/.envaccordingly to credentials contained within/deploy/database/docker-compose.ymlfile (this DB will be empty by default!).
- Do the same to
- Go to
/deploy/app/and execute commanddocker-compose up. In about a minute service should be deployed.
For development purpose
REQUIREMENTS:
npm/npx,node.js,MongoDBinstance with data.
- Clone service's repository.
- In
/copy.env_samplefile and name it.env. Next replace every<...>with adequate data.- Do the same to
/frontend/.env_sample.
- Do the same to
- In
/directory executenpm iornpx i, and thennode server. - In
/frontend/directory executenpm iornpx i, and thennpm run start.
Additional resources
- End User Documentation - DashboardDocumentation.md
- Fetch API Documentation - FetchApiDocumentation.md
- Changelog - CHANGELOG.md