Skip to content
Snippets Groups Projects
Commit 3b967ceb authored by Manos Angelidis's avatar Manos Angelidis Committed by Sandro Weber
Browse files

Merged in NRRPLT-8067 (pull request #8)

[NRRPLT-8067] Added bitbucket pipelines

Approved-by: Sandro Weber
parents 07eb1058 fce3df53
No related branches found
No related tags found
No related merge requests found
# Template NodeJS build
# This template allows you to validate your NodeJS code.
# The workflow allows running tests and code linting on the default branch.
image: node:15.0.1
pipelines:
branches:
development:
- step:
name: Build and Test
caches:
- node
script:
- cp src/mocks/config_test.json src/config.json
- npm install
- npm test
- step:
name: Code linting
script:
- npm install eslint
- npx eslint .
caches:
- node
\ No newline at end of file
{
"api": {
"user": {
"v0": "https://services.humanbrainproject.eu/oidc/v0/api",
"v1": "https://services.humanbrainproject.eu/idm/v1/api"
},
"account": {
"v1": "https://services.humanbrainproject.eu/idm/v1/api"
},
"slurmmonitor": {
"url": "https://neurorobotics-dev.humanbrainproject.eu/slurmmonitor"
},
"document": {
"v0": "https://services.humanbrainproject.eu/document/v0/api",
"v1": "https://services.humanbrainproject.eu/storage/v1/api"
},
"proxy": {
"url": "http://localhost:9000/proxy",
"productionUrl": "http://148.187.97.48/proxy"
},
"kg": {
"url": "https://nexus-int.humanbrainproject.org/v0/data/sp10",
"editor-url": "https://nexus-int.humanbrainproject.org/v0/data/sp10editor"
},
"collab": {
"v0": "https://services.humanbrainproject.eu/collab/v0"
},
"versionCheck": {
"checkEnabled": true,
"releaseNotes": "http://148.187.97.48/releasenotes/",
"checkUpdate": "http://148.187.97.48/proxy/checkupdate"
}
},
"auth": {
"clientId": "neurorobotics-ui",
"url": "https://services.humanbrainproject.eu/oidc"
},
"collab" : {
"features": {
"identity" : {
"userApiV1" : true
}
},
"collabIds": {
"neuroroboticsCollabBaseUrl": "https://collab.humanbrainproject.eu/#/collab/570/nav/",
"pagesId": {
"upgrade": 12893,
"tutorial": 11696,
"exampleExperiments": 5098,
"createCollab": 5650,
"documentation": 12894,
"support": 5101
}
}
},
"ros-topics": {
"spikes": "/monitor/spike_recorder",
"joint": "/joint_states",
"status": "/ros_cle_simulation/status",
"cleError": "/ros_cle_simulation/cle_error",
"logs": "/ros_cle_simulation/logs"
},
"ros-services": {
"modelProperties": {
"name": "/gazebo/get_model_properties",
"type": "gazebo_msgs/GetModelProperties",
"param": "model_name"
},
"jointProperties": {
"name": "/gazebo/get_joint_properties",
"type": "gazebo_msgs/GetJointProperties",
"param": "joint_name"
}
},
"google-analytics": {
"tracking-id": "notracking",
"virtualPageViews": {},
"anonymize-ip": true
}
}
import { rest } from 'msw';
import config from '../config.json';
import endpoints from '../services/proxy/data/endpoints';
var experiments = [
const availableServers = [
{
'internalIp': 'http://localhost:8080',
'gzweb': {
'assets': 'http://localhost:8080/assets',
'nrp-services': 'http://localhost:8080',
'videoStreaming': 'http://localhost:8080/webstream/',
'websocket': 'ws://localhost:8080/gzbridge'
},
'rosbridge': {
'websocket': 'ws://localhost:8080/rosbridge'
},
'serverJobLocation': 'local',
'id': 'localhost'
}
];
const experiments = [
{
'uuid': 'braitenberg_husky_holodeck_1_0_0',
'name': 'braitenberg_husky_holodeck_1_0_0',
......@@ -70,9 +88,14 @@ var experiments = [
}
];
export const handlers = [
rest.get(config.api.proxy.url + '/storage/experiments', (req, res, ctx) => {
rest.get(`${config.api.proxy.url}${endpoints.proxy.storage.experiments.url}`, (req, res, ctx) => {
return res(
ctx.json(experiments)
);
}),
rest.get(`${config.api.proxy.url}${endpoints.proxy.availableServers.url}`, (req, res, ctx) => {
return res(
ctx.json(availableServers)
);
})
];
\ No newline at end of file
......@@ -18,6 +18,7 @@ test('fetches the list of experiments', async () => {
expect(ExperimentStorageService.instance.performRequest).toHaveBeenCalledWith(experimentsUrl, ExperimentStorageService.instance.options);
expect(experiments[0].name).toBe('braitenberg_husky_holodeck_1_0_0');
expect(experiments[1].configuration.maturity).toBe('production');
expect(experiments[1].availableServers[0].internalIp).toBe('http://localhost:8080');
});
test('makes sure that invoking the constructor fails with the right message', () => {
......
......@@ -41,7 +41,7 @@ class ExperimentStorageService extends HttpService {
let response = await this.httpRequestGET(experimentsUrl);
this.experiments = await response.json();
this.sortExperiments();
this.fillExperimentDetails();
await this.fillExperimentDetails();
}
return this.experiments;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment