Commit 2b6abc7a authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch 'tests-integration' into 'develop'

Tests integration

See merge request !59
parents c687104d 7e6dbc78
Pipeline #1585 canceled with stages
in 17 minutes and 31 seconds
...@@ -29,6 +29,7 @@ out-tsc ...@@ -29,6 +29,7 @@ out-tsc
/e2e/*.js /e2e/*.js
/e2e/*.map /e2e/*.map
/typings /typings
/coverage
#--- OTHER ---# #--- OTHER ---#
......
stages: stages:
- install - install
- test
- sonar - sonar
- build - build
- deploy - deploy
...@@ -25,6 +26,27 @@ install: ...@@ -25,6 +26,27 @@ install:
refs: refs:
- develop - develop
test:
image: node:11
stage: test
script:
- yarn global add @angular/cli
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- apt-get update
- apt-get install -y google-chrome-stable
- ng test
cache:
paths:
- dist
- node_modules
- coverage
policy: pull-push
only:
refs:
- develop
sonar_scanner: sonar_scanner:
image: portus.lam.fr/ci-tools/sonar-scanner:latest image: portus.lam.fr/ci-tools/sonar-scanner:latest
stage: sonar stage: sonar
......
# UID := $(id -u) UID := $(id -u)
# GID := $(id -g) GID := $(id -g)
UID := 1000 # UID := 1000
GID := 1000 # GID := 1000
list: list:
@echo "" @echo ""
...@@ -12,9 +12,10 @@ list: ...@@ -12,9 +12,10 @@ list:
@echo " start > run a dev server for anis client application (in memory)" @echo " start > run a dev server for anis client application (in memory)"
@echo " stop > stop the dev server for anis client application" @echo " stop > stop the dev server for anis client application"
@echo " restart > restart the dev server for anis client (container)" @echo " restart > restart the dev server for anis client (container)"
@echo " test > run anis client tests"
@echo " ng-build > generate the angular dist application (html, css, js)" @echo " ng-build > generate the angular dist application (html, css, js)"
@echo " log > display anis client container logs" @echo " log > display anis client container logs"
@echo " debug > shell into anis client container" @echo " shell > shell into anis client container"
@echo "" @echo ""
install: install:
...@@ -26,6 +27,7 @@ start: ...@@ -26,6 +27,7 @@ start:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \ @docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \ --name anis-client \
-p 4200:4200 \ -p 4200:4200 \
-p 9876:9876 \
-v $(CURDIR):/project -d \ -v $(CURDIR):/project -d \
-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200 -w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200
...@@ -36,6 +38,14 @@ stop: ...@@ -36,6 +38,14 @@ stop:
restart: stop start restart: stop start
test:
rm -rf ./coverage
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \
-p 9876:9876 \
-v $(CURDIR):/project -d \
-w /project anis-node ng test --code-coverage
ng-build: ng-build:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \ @docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
-v $(CURDIR):/project \ -v $(CURDIR):/project \
...@@ -44,5 +54,5 @@ ng-build: ...@@ -44,5 +54,5 @@ ng-build:
log: log:
@docker logs -f -t anis-client @docker logs -f -t anis-client
debug: shell:
@docker exec -ti anis-client bash @docker exec -ti anis-client bash
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json", "tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js", "karmaConfig": "karma.conf.js",
"codeCoverage": true,
"assets": [ "assets": [
"src/favicon.ico", "src/favicon.ico",
"src/assets" "src/assets"
......
FROM node:11 FROM node:11
# Yarn
RUN yarn global add @angular/cli RUN yarn global add @angular/cli
RUN ng config -g cli.packageManager yarn RUN ng config -g cli.packageManager yarn
# Chrome
RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN apt-get update \
&& apt-get install -y google-chrome-stable
# ENV CHROME_BIN /usr/bin/google-chrome
CMD ["bash"] CMD ["bash"]
...@@ -2,31 +2,36 @@ ...@@ -2,31 +2,36 @@
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'], frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'), require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma') require('@angular-devkit/build-angular/plugins/karma')
], ],
client: { client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser clearContext: false // leave Jasmine Spec Runner output visible in browser
}, },
coverageIstanbulReporter: { coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/anis-client'), dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly', 'text-summary'], reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true fixWebpackSourcePaths: true
}, },
reporters: ['progress', 'kjhtml'], reporters: ['progress', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['Chrome'], browsers: ['ChromeHeadlessCI'],
singleRun: false, customLaunchers: {
restartOnFileChange: true ChromeHeadlessCI: {
}); base: 'ChromeHeadless',
flags: ['--no-sandbox'],
}
},
singleRun: true,
});
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<app-anis-nav [isAuthenticated]="isAuthenticated | async" [loginToken]="loginToken | async" (logout)="logout()"> <app-anis-nav [isAuthenticated]="isAuthenticated | async" [loginToken]="loginToken | async" (logout)="logout()">
</app-anis-nav> </app-anis-nav>
</header> </header>
<main role="main" class="container flex-shrink-0 pb-4"> <main role="main" class="container-fluid pb-4">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>
<footer class="footer mt-auto bg-light"> <footer class="footer mt-auto bg-light">
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountBenefitsComponent } from './account-benefits.component';
describe('AccountBenefitsComponent', () => {
let component: AccountBenefitsComponent;
let fixture: ComponentFixture<AccountBenefitsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountBenefitsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AccountBenefitsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
...@@ -91,15 +91,15 @@ ...@@ -91,15 +91,15 @@
} }
.datasetStep { .datasetStep {
width: 10%; width: 11%;
} }
.criteriaStep { .criteriaStep {
width: 35%; width: 36%;
} }
.outputStep { .outputStep {
width: 60%; width: 61%;
} }
.resultStep { .resultStep {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</div> </div>
<div *ngIf="(criteriaSearchMetaIsLoaded | async) && (datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)" <div *ngIf="(criteriaSearchMetaIsLoaded | async) && (datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)"
class="row mt-4"> class="row mt-4">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8 col-lg-9">
<app-criteria-tabs <app-criteria-tabs
[criteriaFamilyList]="criteriaFamilyList | async" [criteriaFamilyList]="criteriaFamilyList | async"
[datasetAttributeList]="datasetAttributeList | async" [datasetAttributeList]="datasetAttributeList | async"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
(deleteCriterion)="deleteCriterion($event)"> (deleteCriterion)="deleteCriterion($event)">
</app-criteria-tabs> </app-criteria-tabs>
</div> </div>
<div class="col-12 col-md-4 pt-2"> <div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary <app-summary
[datasetName]="datasetName | async" [datasetName]="datasetName | async"
[currentStep]="currentStep | async" [currentStep]="currentStep | async"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
<div *ngIf="datasetSearchMetaIsLoaded | async" class="row mt-4"> <div *ngIf="datasetSearchMetaIsLoaded | async" class="row mt-4">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8 col-lg-9">
<app-dataset-tabs <app-dataset-tabs
[projectList]="projectList | async" [projectList]="projectList | async"
[datasetList]="datasetList | async" [datasetList]="datasetList | async"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
(select)="selectDataset($event)"> (select)="selectDataset($event)">
</app-dataset-tabs> </app-dataset-tabs>
</div> </div>
<div class="col-12 col-md-4 pt-2"> <div class="col-12 col-md-4 col-lg-3 pt-2">
<div *ngIf="attributeSearchMetaIsLoading | async" class="row justify-content-center mt-5"> <div *ngIf="attributeSearchMetaIsLoading | async" class="row justify-content-center mt-5">
<span class="fas fa-circle-notch fa-spin fa-3x"></span> <span class="fas fa-circle-notch fa-spin fa-3x"></span>
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</div> </div>
<div *ngIf="(outputSearchMetaIsLoaded | async) && (datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)" <div *ngIf="(outputSearchMetaIsLoaded | async) && (datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)"
class="row mt-4"> class="row mt-4">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8 col-lg-9">
<app-output-tabs <app-output-tabs
[outputFamilyList]="outputFamilyList | async" [outputFamilyList]="outputFamilyList | async"
[categoryList]="categoryList | async" [categoryList]="categoryList | async"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
(changed)="updateOutputList($event)"> (changed)="updateOutputList($event)">
</app-output-tabs> </app-output-tabs>
</div> </div>
<div class="col-12 col-md-4 pt-2"> <div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary <app-summary
[datasetName]="datasetName | async" [datasetName]="datasetName | async"
[currentStep]="currentStep | async" [currentStep]="currentStep | async"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
<div *ngIf="(datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)" class="row mt-4"> <div *ngIf="(datasetSearchMetaIsLoaded | async) && (attributeSearchMetaIsLoaded | async)" class="row mt-4">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8 col-lg-9">
<app-url-display <app-url-display
[apiPath]="apiPath" [apiPath]="apiPath"
[instanceName]="instanceName" [instanceName]="instanceName"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
(executeProcess)="executeProcess($event)"> (executeProcess)="executeProcess($event)">
</app-datatable> </app-datatable>
</div> </div>
<div class="col-12 col-md-4 pt-2"> <div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary <app-summary
[datasetName]="datasetName | async" [datasetName]="datasetName | async"
[currentStep]="currentStep | async" [currentStep]="currentStep | async"
......
<app-progress <div class="mx-5 px-5">
[currentStep]="currentStep | async" <app-progress
[datasetName]="datasetName | async" [currentStep]="currentStep | async"
[criteriaStepChecked]="criteriaStepChecked | async" [datasetName]="datasetName | async"
[outputStepChecked]="outputStepChecked | async" [criteriaStepChecked]="criteriaStepChecked | async"
[resultStepChecked]="resultStepChecked | async" [outputStepChecked]="outputStepChecked | async"
[queryParams]="queryParams | async"> [resultStepChecked]="resultStepChecked | async"
</app-progress> [queryParams]="queryParams | async">
<router-outlet></router-outlet> </app-progress>
\ No newline at end of file <router-outlet></router-outlet>
</div>
\ No newline at end of file
<div class="jumbotron"> <div class="container">
<div class="row align-items-center"> <div class="row align-items-center jumbotron">
<div class="col-6 mx-auto col-md-6 order-md-2 text-center"> <div class="col-6 col-md-4 order-md-2 mx-auto text-center">
<img class="img-fluid mb-3 mb-md-0" src="../../assets/anis_v3_logo300.png" alt=""> <img class="img-fluid mb-3 mb-md-0" src="../../assets/anis_v3_logo300.png" alt="">
</div> </div>
<div class="col-md-6 order-md-1 text-justify text-md-left pr-md-5"> <div class="col-md-8 order-md-1 text-justify pr-md-5">
<h1 class="mb-3">ANIS</h1> <h1 class="mb-3">ANIS</h1>
<p class="lead"> <p class="lead">
AstroNomical Information System is a generic web tool aimed at facilitating and homogenizing the AstroNomical Information System is a generic web tool aimed at facilitating and homogenizing the
implementation of astronomical data. implementation of astronomical data.
It allows the fast implementation of a project data exchange platform in a dedicated information system. It allows the fast implementation of a project data exchange platform in a dedicated information
system.
</p> </p>
<p class="lead"> <p class="lead">
ANIS provides services like searching, displaying images and spectroscopic data and ANIS provides services like searching, displaying images and spectroscopic data and
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
...@@ -3199,6 +3199,11 @@ interpret@^1.0.0: ...@@ -3199,6 +3199,11 @@ interpret@^1.0.0:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==
intl@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde"
integrity sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94=
invariant@^2.2.2: invariant@^2.2.2:
version "2.2.4" version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
......
Markdown is supported
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