Skip to content
Snippets Groups Projects
Commit 05b55739 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: add sonar again

parent eb32fd55
No related branches found
No related tags found
2 merge requests!2921.17,!253fix: add sonar again
stages:
- sonar-analysis
- quality
- build
- deploy
......@@ -16,6 +16,8 @@ build_branch:
DOCKER_TLS_CERTDIR: ''
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
only:
- merge_requests
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
stage: build
except:
......@@ -102,36 +104,53 @@ deploy_rec:
environment:
name: rec
url: https://resin-rec.grandlyon.com
# code_analysis:
# image: skilldlabs/sonar-scanner:3.4.0
# services:
# - docker:18.09-dind
# stage: sonar-analysis
# only:
# - dev
# before_script:
# - export NODE_PATH=$NODE_PATH:`npm root -g`
# - npm install -g typescript
# script:
# - >
# sonar-scanner
# -Dsonar.projectName=${SONAR_PROJECT_KEY}
# -Dsonar.projectVersion=1.0
# -Dsonar.sourceEncoding=UTF-8
# -Dsonar.projectBaseDir=.
# -Dsonar.host.url=${SONAR_URL}
# -Dsonar.projectKey=${SONAR_PROJECT_KEY}
# -Dsonar.login=${SONAR_TOKEN}
# mr:
# variables:
# DOCKER_TLS_CERTDIR: ''
# DOCKER_HOST: tcp://docker:2375/
# DOCKER_DRIVER: overlay2
# image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
# stage: build
# only:
# - merge_requests
# script:
# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# - docker build --pull -t "$CI_REGISTRY_IMAGE:dev" --build-arg conf=dev .
sonarqube:
stage: quality
only:
- dev
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/sonarsource/sonar-scanner-cli:4
variables:
SONAR_USER_HOME: '${CI_PROJECT_DIR}/.sonar' # Defines the location of the analysis task cache
GIT_DEPTH: '0' # T
cache:
key: '${CI_JOB_NAME}'
paths:
- .sonar/cache
script:
- >
sonar-scanner
-Dsonar.projectName=${SONAR_PROJECT_KEY}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=.
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_TOKEN}
-Dsonar.cpd.exclusions=tests/**,src/**/*.spec.ts*
-Dsonar.qualitygate.wait=true
sonarqube-mr:
stage: quality
only:
- merge_requests
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/sonarsource/sonar-scanner-cli:4
variables:
SONAR_USER_HOME: '${CI_PROJECT_DIR}/.sonar' # Defines the location of the analysis task cache
GIT_DEPTH: '0' # T
cache:
key: '${CI_JOB_NAME}'
paths:
- .sonar/cache
script:
- >
sonar-scanner
-Dsonar.projectName=${SONAR_PROJECT_KEY}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=.
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_MR_TOKEN}
-Dsonar.cpd.exclusions=tests/**,src/**/*.spec.ts*
-Dsonar.qualitygate.wait=true
import { Component } from '@angular/core';
import { User } from '../../../models/user.model';
import { AdminService } from '../../services/admin.service';
import { DeleteUserComponent } from './delete-user/delete-user.component';
import { AdministredStructuresComponent } from './administred-structures/administred-structures.component';
import { DeleteUserComponent } from './delete-user/delete-user.component';
@Component({
selector: 'app-admin-manage-users',
......@@ -105,7 +105,7 @@ export class ManageUsersComponent {
public findAttachedUsers(): void {
this.adminService.getAttachedUsers().subscribe((users) => {
this.attachedUsers = users;
this.attachedUsers.map((user) => {
this.attachedUsers.forEach((user) => {
user._id = user['id'];
});
});
......@@ -120,7 +120,7 @@ export class ManageUsersComponent {
public findUnVerifiedUsers(): void {
this.adminService.getUnVerifiedUsers().subscribe((users) => {
this.unVerifiedUsers = users;
this.unVerifiedUsers.map((user) => {
this.unVerifiedUsers.forEach((user) => {
user._id = user['id'];
});
});
......
......@@ -25,8 +25,15 @@
</div>
<div class="beneficiary">
<div class="informationHeader">{{ 'Bénéficiaire' | uppercase }}</div>
<!-- Name -->
<table class="beneficiaryNeeds">
<caption style="display: none">
Résumé du besoin de l'utilisateur pour impresion.
</caption>
<thead style="display: none">
<th>Résumé de besoin</th>
</thead>
<!-- Name -->
<tr>
<td class="informationHeader">Nom</td>
<td class="bold">{{ beneficiaryName }}</td>
......
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { of } from 'rxjs';
import { GeoJson } from '../../../map/models/geojson.model';
import { GeojsonService } from '../../../services/geojson.service';
import { TypeModal } from '../../enum/typeModal.enum';
import { Filter } from '../../models/filter.model';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { StructureListSearchComponent } from './structure-list-search.component';
import { Module } from '../../models/module.model';
import { TypeModal } from '../../enum/typeModal.enum';
import { GeojsonService } from '../../../services/geojson.service';
import { GeoJson } from '../../../map/models/geojson.model';
import { of } from 'rxjs';
import { StructureListSearchComponent } from './structure-list-search.component';
describe('StructureListSearchComponent', () => {
let component: StructureListSearchComponent;
......@@ -104,7 +104,6 @@ describe('StructureListSearchComponent', () => {
const checkedModules: Module[] = [{ id: evt.target.value, text: categ, count: 0 }];
component.checkedModulesFilter = checkedModules;
component.externalCheckboxCheck(evt, categ);
new Module(evt.target.value, categ);
expect(component.checkedModulesFilter.length).toEqual(0);
expect(component.numberMoreFiltersChecked).toEqual(0);
});
......@@ -122,7 +121,6 @@ describe('StructureListSearchComponent', () => {
const checkedModules: Module[] = [{ id: evt.target.value, text: categ, count: 0 }];
component.checkedModulesFilter = checkedModules;
component.externalCheckboxCheck(evt, categ);
new Module(evt.target.value, categ);
expect(component.checkedModulesFilter.length).toEqual(0);
expect(component.numberMoreFiltersChecked).toEqual(0);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment