Skip to content

Commit

Permalink
Fix gulp test task execution
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Shumilova <[email protected]>
  • Loading branch information
Anna Shumilova authored and ashumilova committed Sep 8, 2017
1 parent 4523999 commit b952135
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 24 deletions.
10 changes: 6 additions & 4 deletions dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
# Build step: $ docker build -t eclipse-che-dashboard
# It builds an archive file that can be used by doing later
# $ docker run --rm eclipse-che-dashboard | tar -C target/ -zxf -
FROM mhart/alpine-node:6.11.2
FROM node:6.11.2

RUN apk update && \
apk add --no-cache git
RUN apt-get update && \
apt-get install -y git \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
COPY package.json /dashboard/
RUN cd /dashboard && npm install
COPY bower.json /dashboard/
RUN cd /dashboard && ./node_modules/.bin/bower install --allow-root
COPY . /dashboard/
RUN cd /dashboard && npm run build && cd target/ && tar zcf /tmp/dashboard.tar.gz dist/
RUN cd /dashboard && npm run build && npm run test && cd target/ && tar zcf /tmp/dashboard.tar.gz dist/

CMD zcat /tmp/dashboard.tar.gz
3 changes: 2 additions & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"postinstall": "npm run bower && npm run typings && npm run build",
"bower": "bower update",
"typings": "typings install",
"build": "gulp build"
"build": "gulp build",
"test": "gulp test"
}
}
5 changes: 3 additions & 2 deletions dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@
<configuration>
<target unless="skipTests">
<!-- Run unit tests -->
<exec dir="${basedir}" executable="gulp" failonerror="true">
<arg value="test" />
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="run" />
<arg value="test" />
</exec>
</target>
</configuration>
Expand Down
8 changes: 6 additions & 2 deletions dashboard/src/components/api/che-git.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ describe('CheGit', function () {
var workspaceId = 'workspace123test';
var projectPath = '/testProject';
var localUrl = 'https://eclipse.org/che/git/f1/' + workspaceId + projectPath;
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
var agentWsUrl = 'ws://localhost:3232/wsagent/ws';
var devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
var workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();

cheBackend.addWorkspaces([workspace1]);
Expand Down Expand Up @@ -122,7 +124,9 @@ describe('CheGit', function () {
'url': 'https://github.com/test3',
'name': 'test2'
}];
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
var agentWsUrl = 'ws://localhost:3232/wsagent/ws';
var devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
var workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();
cheBackend.addWorkspaces([workspace1]);

Expand Down
13 changes: 7 additions & 6 deletions dashboard/src/components/api/che-project-type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ describe('CheProjectType', function(){
it('Fetch project types', function() {

// setup tests objects
var attributeLanguageJava = apiBuilder.getProjectTypeAttributeDescriptorBuilder().withValues(['java']).withRequired(true).withDescription('language').withName('language').build();
var mavenType = apiBuilder.getProjectTypeBuilder().withId('maven').withDisplayname('Maven project').withAttributeDescriptors([attributeLanguageJava]).build();
var antType = apiBuilder.getProjectTypeBuilder().withId('ant').withDisplayname('Ant project').withAttributeDescriptors([attributeLanguageJava]).build();
let attributeLanguageJava = apiBuilder.getProjectTypeAttributeDescriptorBuilder().withValues(['java']).withRequired(true).withDescription('language').withName('language').build();
let mavenType = apiBuilder.getProjectTypeBuilder().withId('maven').withDisplayname('Maven project').withAttributeDescriptors([attributeLanguageJava]).build();
let antType = apiBuilder.getProjectTypeBuilder().withId('ant').withDisplayname('Ant project').withAttributeDescriptors([attributeLanguageJava]).build();
let workspaceId = 'florentWorkspace';
let agentUrl = 'localhost:3232/wsagent/ext';

var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
var workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();
let agentWsUrl = 'ws://localhost:3232/wsagent/ws';
let devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};
let runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
let workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();

cheBackend.addWorkspaces([workspace1]);

Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/components/api/che-project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ describe('CheProject', function () {
workspaceId: 'workspace12345'
};
let agentUrl = 'localhost:3232/wsagent/ext';
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
var agentWsUrl = 'ws://localhost:3232/wsagent/ws';
var devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
var workspace1 = apiBuilder.getWorkspaceBuilder().withId(testProjectDetails.workspaceId).withRuntime(runtime).build();

cheBackend.addWorkspaces([workspace1]);
Expand Down
14 changes: 8 additions & 6 deletions dashboard/src/components/api/che-svn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ describe('CheSvn', function () {
*/
it('Fetch remote svn url', function () {
// setup tests objects
var agentUrl = 'localhost:3232/wsagent/ext';
var workspaceId = 'workspace456test';
var projectPath = '/testSvnProject';
var remoteSvnUrl = 'https://svn.apache.org' + projectPath;
var runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
var workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();
let agentUrl = 'localhost:3232/wsagent/ext';
let workspaceId = 'workspace456test';
let projectPath = '/testSvnProject';
let remoteSvnUrl = 'https://svn.apache.org' + projectPath;
let agentWsUrl = 'ws://localhost:3232/wsagent/ws';
let devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};
let runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
let workspace1 = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();

cheBackend.addWorkspaces([workspace1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ describe('CheTypeResolver', () => {
let workspaceId = 'workspaceTest';

let agentUrl = 'localhost:3232/wsagent/ext';

let agentWsUrl = 'ws://localhost:3232/wsagent/ws';
let devMachine = {'links': [{'href': agentWsUrl, 'rel': 'wsagent.websocket'}]};

/**
* API builder.
Expand Down Expand Up @@ -59,7 +60,7 @@ describe('CheTypeResolver', () => {
cheBackend = cheHttpBackend;
httpBackend = cheHttpBackend.getHttpBackend();
// setup tests workspace
let runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}]};
let runtime = {'links': [{'href': agentUrl, 'rel': 'wsagent'}], 'devMachine': devMachine};
let test_workspace = apiBuilder.getWorkspaceBuilder().withId(workspaceId).withRuntime(runtime).build();
cheBackend.addWorkspaces([test_workspace]);
// setup backend
Expand Down

0 comments on commit b952135

Please sign in to comment.