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
/e2e/*.js
/e2e/*.map
/typings
/coverage
#--- OTHER ---#
......
stages:
- install
- test
- sonar
- build
- deploy
......@@ -25,6 +26,27 @@ install:
refs:
- 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:
image: portus.lam.fr/ci-tools/sonar-scanner:latest
stage: sonar
......
# UID := $(id -u)
# GID := $(id -g)
UID := $(id -u)
GID := $(id -g)
UID := 1000
GID := 1000
# UID := 1000
# GID := 1000
list:
@echo ""
......@@ -12,9 +12,10 @@ list:
@echo " start > run a dev server for anis client application (in memory)"
@echo " stop > stop the dev server for anis client application"
@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 " log > display anis client container logs"
@echo " debug > shell into anis client container"
@echo " shell > shell into anis client container"
@echo ""
install:
......@@ -26,6 +27,7 @@ start:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \
-p 4200:4200 \
-p 9876:9876 \
-v $(CURDIR):/project -d \
-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200
......@@ -36,6 +38,14 @@ stop:
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:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
-v $(CURDIR):/project \
......@@ -44,5 +54,5 @@ ng-build:
log:
@docker logs -f -t anis-client
debug:
shell:
@docker exec -ti anis-client bash
......@@ -86,6 +86,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"codeCoverage": true,
"assets": [
"src/favicon.ico",
"src/assets"
......
FROM node:11
# Yarn
RUN yarn global add @angular/cli
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"]
......@@ -16,7 +16,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/anis-client'),
dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
......@@ -25,8 +25,13 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
browsers: ['ChromeHeadlessCI'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
}
},
singleRun: true,
});
};
......@@ -2,7 +2,7 @@
<app-anis-nav [isAuthenticated]="isAuthenticated | async" [loginToken]="loginToken | async" (logout)="logout()">
</app-anis-nav>
</header>
<main role="main" class="container flex-shrink-0 pb-4">
<main role="main" class="container-fluid pb-4">
<router-outlet></router-outlet>
</main>
<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 @@
}
.datasetStep {
width: 10%;
width: 11%;
}
.criteriaStep {
width: 35%;
width: 36%;
}
.outputStep {
width: 60%;
width: 61%;
}
.resultStep {
......
......@@ -5,7 +5,7 @@
</div>
<div *ngIf="(criteriaSearchMetaIsLoaded | async) && (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-criteria-tabs
[criteriaFamilyList]="criteriaFamilyList | async"
[datasetAttributeList]="datasetAttributeList | async"
......@@ -14,7 +14,7 @@
(deleteCriterion)="deleteCriterion($event)">
</app-criteria-tabs>
</div>
<div class="col-12 col-md-4 pt-2">
<div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary
[datasetName]="datasetName | async"
[currentStep]="currentStep | async"
......
......@@ -3,7 +3,7 @@
<span class="sr-only">Loading...</span>
</div>
<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
[projectList]="projectList | async"
[datasetList]="datasetList | async"
......@@ -12,7 +12,7 @@
(select)="selectDataset($event)">
</app-dataset-tabs>
</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">
<span class="fas fa-circle-notch fa-spin fa-3x"></span>
<span class="sr-only">Loading...</span>
......
......@@ -5,7 +5,7 @@
</div>
<div *ngIf="(outputSearchMetaIsLoaded | async) && (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-output-tabs
[outputFamilyList]="outputFamilyList | async"
[categoryList]="categoryList | async"
......@@ -14,7 +14,7 @@
(changed)="updateOutputList($event)">
</app-output-tabs>
</div>
<div class="col-12 col-md-4 pt-2">
<div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary
[datasetName]="datasetName | async"
[currentStep]="currentStep | async"
......
......@@ -4,7 +4,7 @@
<span class="sr-only">Loading...</span>
</div>
<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
[apiPath]="apiPath"
[instanceName]="instanceName"
......@@ -30,7 +30,7 @@
(executeProcess)="executeProcess($event)">
</app-datatable>
</div>
<div class="col-12 col-md-4 pt-2">
<div class="col-12 col-md-4 col-lg-3 pt-2">
<app-summary
[datasetName]="datasetName | async"
[currentStep]="currentStep | async"
......
<app-progress
<div class="mx-5 px-5">
<app-progress
[currentStep]="currentStep | async"
[datasetName]="datasetName | async"
[criteriaStepChecked]="criteriaStepChecked | async"
[outputStepChecked]="outputStepChecked | async"
[resultStepChecked]="resultStepChecked | async"
[queryParams]="queryParams | async">
</app-progress>
<router-outlet></router-outlet>
\ No newline at end of file
</app-progress>
<router-outlet></router-outlet>
</div>
\ No newline at end of file
<div class="jumbotron">
<div class="row align-items-center">
<div class="col-6 mx-auto col-md-6 order-md-2 text-center">
<div class="container">
<div class="row align-items-center jumbotron">
<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="">
</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>
<p class="lead">
AstroNomical Information System is a generic web tool aimed at facilitating and homogenizing the
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 class="lead">
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:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
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:
version "2.2.4"
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