Commit c02d713d authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'feature-addNewActivityData' into 'dev'

Feature-addNewActivityData

See merge request redmic-project/client/web!92
parents 50631563 eb507e78
Loading
Loading
Loading
Loading
+96 −30
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ stages:
  - deploy
  - test-deploy

variables:
  PROJECT_PARENT_NAME: client

.web-build:
  image: ${WEB_BUILD_IMAGE_NAME}:${WEB_BUILD_IMAGE_TAG}
  variables:
@@ -68,27 +65,99 @@ prepare-unbuilt-version:
      - public/stylesheets/submodules/
  rules: *only-non-master-branches-job-rules

run-unit-tests:
.run-tests:
  extends: .web-build
  tags:
    - custom-runner
  cache:
    policy: pull

.run-pre-build-tests:
  extends: .run-tests
  stage: pre-build
  script:
    - grunt test | tee test.out
  rules: *only-non-master-branches-job-rules
  allow_failure: true

.run-local-tests:
  variables: &run-local-tests-variables
    TEST_BROWSER: chrome

.run-remote-tests:
  variables: &run-remote-tests-variables
    TEST_REMOTE_HOST: selenium-hub

.run-unit-tests:
  extends: .run-pre-build-tests
  after_script:
    - coverage=$(grep '^All files.*' test.out | cut -d '|' -f 2 | tr -d ' ')
    - echo "Coverage - ${coverage}%"
    - rm test.out
  cache:
    policy: pull
  rules: *only-non-master-branches-job-rules

run-modules-functional-tests:
  extends: .web-build
  stage: pre-build
run-local-unit-tests:
  extends: .run-unit-tests
  variables:
    <<: *run-local-tests-variables
  script:
    - grunt test-unit-local --headless --browser=${TEST_BROWSER} | tee test.out

.run-remote-unit-tests:
  extends: .run-unit-tests
  variables:
    <<: *run-remote-tests-variables
  script:
    - >
      grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}"
      --remoteHost=${TEST_REMOTE_HOST} | tee test.out

run-remote-unit-tests-chrome:
  extends: .run-remote-unit-tests
  variables:
    TEST_BROWSER: chrome

run-remote-unit-tests-firefox:
  extends: .run-remote-unit-tests
  variables:
    TEST_BROWSER: firefox

.run-functional-tests:
  artifacts: &run-functional-tests-artifacts
    name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}
    expire_in: 1 month
    when: always
    paths:
      - 'test_reports/test-functional*'

run-local-modules-functional-tests:
  extends: .run-pre-build-tests
  variables:
    <<: *run-local-tests-variables
  script:
    - npm start &
    - grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
  cache:
    policy: pull
  rules: *only-non-master-branches-job-rules
    - >
      grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
      --browser=${TEST_BROWSER}
  artifacts: &run-functional-tests-artifacts

.run-remote-modules-functional-tests:
  extends: .run-pre-build-tests
  variables:
    <<: *run-remote-tests-variables
  script:
    - npm start &
    - >
      grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
      --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST}
  artifacts: &run-functional-tests-artifacts

run-remote-modules-functional-tests-chrome:
  extends: .run-remote-modules-functional-tests
  variables:
    TEST_BROWSER: chrome

run-remote-modules-functional-tests-firefox:
  extends: .run-remote-modules-functional-tests
  variables:
    TEST_BROWSER: firefox

prepare-built-version:
  extends: .web-build
@@ -109,26 +178,23 @@ prepare-built-version:

.deploy:
  variables:
    STACK: ${PROJECT_PARENT_NAME}
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}
    STACK: client
  environment:
    url: https://${PUBLIC_HOSTNAME}

run-functional-tests:
  extends: .web-build
run-scheduled-remote-functional-tests:
  extends: .run-tests
  stage: test-deploy
  variables:
    <<: *run-remote-tests-variables
    SERVER_URL: https://${DEV_PUBLIC_HOSTNAME}
    TEST_BROWSER: chrome
    TEST_ROLE: administrator
  script:
    - >
      grunt test-functional-local --serverUrl="https://${DEV_PUBLIC_HOSTNAME}" --user="${REDMIC_TEST_USER}"
      --pass="${REDMIC_TEST_PASS}" --role=administrator --suitesGroups="${SUITES_GROUPS}" --headless
      grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}"
      --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST}
  dependencies: []
  cache:
    policy: pull
  artifacts:
    name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}
    expire_in: 1 month
    when: always
    paths:
      - 'test_reports/test-functional-local*'
  artifacts: &run-functional-tests-artifacts
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
+0 −1
Original line number Diff line number Diff line
@@ -171,7 +171,6 @@ function expose(app) {
	} else {
		require('./styles')(app);
		exposeContents(app, 'public');
		exposeContents(app, 'tests');
		exposeContents(app, 'node_modules');
	}

+20 −12
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ module.exports = function(grunt) {
			ownServerPort = parseInt(grunt.option('ownServerPort'), 10) || 9000,
			ownSocketPort = parseInt(grunt.option('ownSocketPort'), 10),
			ownTunnelPort = parseInt(grunt.option('ownTunnelPort'), 10),
			browser = grunt.option('browser') || 'chrome',
			headless = grunt.option('headless') || false,
			serverUrl = grunt.option('serverUrl'),
			role = grunt.option('role'),
@@ -84,42 +85,49 @@ module.exports = function(grunt) {
			testFunctionalRemotePath = path.join(absoluteTestsPath, 'intern-functional-remote'),
			dojoCommonBaseUrl = path.join(' ', srcPath, '*').trim(),

			ipGetterPath = path.join(absoluteTestsPath, 'IpGetter'),
			IpGetter = require(ipGetterPath)(),
			localIp = IpGetter.getIp(),

			testParams = {
				srcPath: srcPath,
				testsPath: testsPath,
				ownServerPort: ownServerPort,
				ownSocketPort: ownSocketPort,
				ownTunnelPort: ownTunnelPort,
				suitesGroups: suitesGroups
				suitesGroups: suitesGroups,
				browser: browser,
				headless: headless,
				userDataDir: userDataDir
			},
			remoteTestParams = {
				ownServerHost: ownServerHost,
				remoteHost: remoteHost,
				remotePort: remotePort,
				localIp: localIp
			},
			testUnitParams = deepmerge(testParams, {
				reporters: unitReporters,
				suites: suites,
				coverage: coverage,
				dojoBaseUrl: dojoCommonBaseUrl,
				userDataDir: userDataDir
				dojoBaseUrl: dojoCommonBaseUrl
			}),
			testFunctionalParams = deepmerge(testParams, {
				serverUrl: serverUrl,
				role: role,
				user: user,
				pass: pass,
				headless: headless,
				reporters: functionalReporters,
				functionalSuites: functionalSuites,
				reportersOutputPath: reportersOutputPath,
				dojoBaseUrl: '.' + dojoCommonBaseUrl,
				userDataDir: userDataDir,
				remoteHost: remoteHost,
				remotePort: remotePort
				dojoBaseUrl: '.' + dojoCommonBaseUrl
			}),

			testUnitLocalOptions = require(testUnitLocalPath)(testUnitParams),
			testUnitRemoteOptions = require(testUnitRemotePath)(deepmerge(testUnitParams, {
				ownServerHost: ownServerHost
			})),
			testUnitRemoteOptions = require(testUnitRemotePath)(deepmerge(testUnitParams, remoteTestParams)),
			testFunctionalLocalOptions = require(testFunctionalLocalPath)(testFunctionalParams),
			testFunctionalRemoteOptions = require(testFunctionalRemotePath)(testFunctionalParams);
			testFunctionalRemoteOptions = require(testFunctionalRemotePath)(deepmerge(testFunctionalParams,
				remoteTestParams));

		grunt.config('intern', {
			'test-unit-local': {
+5 −3
Original line number Diff line number Diff line
@@ -7,11 +7,15 @@ module.exports = function(grunt) {
			, '"--ownSocketPort=port" para redefinir puerto del socket de intern (por defecto, "ownServerPort" + 1)'
			, '"--ownTunnelPort=port" para redefinir puerto del túnel selenium (por defecto, "ownServerPort" + 2)'
			, '"--suitesGroups=suitesFolderName" para indicar grupos de suites ejecutar desde la raíz correspondiente'
			, '"--browser" para elegir navegadores a usar, soporta definiciones múltiples y lista separada por comas ' +
				'(por defecto, chrome)'
			, '"--headless" para ejecutar sin interfaz'
		],

		remoteOptionParameters = [
			'"--remoteHost=host" para redefinir la dirección del servicio de testeo remoto'
			, '"--remotePort=port" para redefinir el puerto del servicio de testeo remoto'
			, '"--ownServerHost=host" para redefinir dirección del servidor de intern, para indicarle al túnel remoto'
		],

		unitOptionParameters = [
@@ -24,7 +28,6 @@ module.exports = function(grunt) {
			, '"--role=userRole" para definir el nivel de permisos del usuario'
			, '"--user=userEmail" para definir el nombre de acceso del usuario'
			, '"--pass=userPassword" para definir el password de acceso del usuario'
			, '"--headless" para ejecutar sin interfaz'
			, '"--serverUrl=url" para definir la dirección de la aplicación a testear'
		];

@@ -43,8 +46,7 @@ module.exports = function(grunt) {
		commonTasks.concat(['intern:test-functional-local']));

	grunt.registerTask('test-unit-remote',
		['Ejecuta los tests unitarios en entorno remoto'
			, '"--ownServerHost=host" para redefinir dirección del servidor de intern, para indicarle al túnel remoto']
		['Ejecuta los tests unitarios en entorno remoto']
			.concat(commonOptionParameters)
			.concat(unitOptionParameters)
			.concat(remoteOptionParameters)
+4 −6
Original line number Diff line number Diff line
{
  "name": "REDMIC",
  "name": "redmic",
  "version": "0.20.3",
  "author": "REDMIC",
  "homepage": "https://gitlab.com/redmic-project/client/web/blob/master/README.md",
  "description": "Integrated marine data repository of Canary Islands - Client",
  "contributors": [
    {
      "name": "Ignacio Lorenzo García",
      "email": "nacho@oag-fundacion.org"
      "name": "Ignacio Lorenzo García"
    },
    {
      "name": "Pedro E. Trujillo Brito",
@@ -18,8 +17,7 @@
      "email": "noel@redmic.es"
    },
    {
      "name": "Carlos Alberto González Carballo",
      "email": "carlos@redmic.es"
      "name": "Carlos Alberto González Carballo"
    }
  ],
  "repository": {
@@ -66,7 +64,7 @@
    "gulp": "^2.7.0",
    "gulp-cli": "^2.2.0",
    "handlebars": "^4.0.11",
    "intern": "^4.2.0",
    "intern": "^4.9.0",
    "jshint": "^2.9.5",
    "json-schema-ref-parser": "^5.0.3",
    "leaflet": "^1.3.0",
Loading