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

Permite definir la url a testear y corrige job CI

Para ejecutar tests funcionales, tanto locales como remotos, ahora es
posible decidir la url de la aplicación a testear (incluyendo a la
ejecución en paralelo).
Prepara job de CI para lanzar los tests funcionales en paralelo por
eventos de calendario.
parent 8ba6b12c
Loading
Loading
Loading
Loading
+15 −16
Original line number Diff line number Diff line
@@ -14,9 +14,9 @@ prepare-unbuilt-version:
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
    - 'type yarn grunt java'
    - 'yarn install || yarn install'
    - 'grunt preBuild'
    - type yarn grunt java
    - yarn install || yarn install
    - grunt preBuild
  only:
    - branches
  except:
@@ -42,7 +42,7 @@ prepare-unbuilt-version:

run-unit-tests:
  stage: test-code
  script: 'grunt test-unit-local'
  script: grunt test
  only:
    - branches
  except:
@@ -59,9 +59,9 @@ run-unit-tests:
run-modules-functional-tests:
  stage: test-code
  script:
    - 'echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts'
    - 'npm start -- -p 80 &'
    - 'grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless'
    - echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts
    - npm start -- -p 80 &
    - grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
  only:
    - branches
  except:
@@ -80,9 +80,9 @@ prepare-built-version:
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
    - 'type yarn grunt java'
    - 'yarn install || yarn install'
    - 'grunt'
    - type yarn grunt java
    - yarn install || yarn install
    - grunt
  only:
    - branches
    - tags
@@ -212,18 +212,17 @@ deploy-supporting-branch:
run-functional-tests:
  stage: test-deploy
  script:
    - 'echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts'
    - 'npm start -- -p 80 &'
    - 'grunt test-functional-local-parallel --user=${REDMIC_USER} --pass=${REDMIC_PASS}'
    - type yarn grunt java
    - yarn install || yarn install
    - >
      grunt test-functional-local-parallel --server-url="https://appdev.${DEV_PUBLIC_HOSTNAME}" --user="${REDMIC_USER}"
      --pass="${REDMIC_PASS}"
  only:
    - schedules
  cache:
    key: '${CI_COMMIT_REF_NAME}'
    paths:
      - node_modules/
      - public/javascript/redmic-widgets/node_modules/
      - public/javascript/templates/node_modules/
      - public/stylesheets/node_modules/
    policy: pull

deploy-pro:
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ module.exports = function(grunt) {
			ownSocketPort = parseInt(grunt.option('ownSocketPort'), 10),
			ownTunnelPort = parseInt(grunt.option('ownTunnelPort'), 10),
			headless = grunt.option('headless') || false,
			serverUrl = grunt.option('server-url'),
			role = grunt.option('role'),
			user = grunt.option('user'),
			pass = grunt.option('pass'),
@@ -92,6 +93,7 @@ module.exports = function(grunt) {
				dojoBaseUrl: dojoCommonBaseUrl
			}),
			testFunctionalParams = deepmerge(testParams, {
				serverUrl: serverUrl,
				role: role,
				user: user,
				pass: pass,
+3 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ module.exports = function(grunt) {
			, '"--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'
			, '"--server-url=url" para definir la dirección de la aplicación a testear'
		];

	grunt.registerTask('test-unit-local',
@@ -60,10 +61,11 @@ module.exports = function(grunt) {
		grunt.config('shell.test-functional-local-parallel', {
			command: function() {

				var gruntCommand = 'grunt test-functional-local --headless',
				var serverUrlParam = grunt.option('server-url'),
					userParam = grunt.option('user'),
					passParam = grunt.option('pass'),
					serverPort = 9000,
					gruntCommand = 'grunt test-functional-local --headless --server-url="' + serverUrlParam + '"',

					publicZoneGroups = 'catalog,catalogDetails,viewers,products',
					administrativeZoneGroup = 'administrative,!administrative/taxonomy',
+3 −1
Original line number Diff line number Diff line
@@ -4,8 +4,10 @@ module.exports = function(args) {

		_internFunctional = require('./_intern-functional')(args),

		serverUrl = args.serverUrl || 'http://redmic.local',

		config = {
			serverUrl: 'http://redmic.local'
			serverUrl: serverUrl
		};

	return deepmerge(_internFunctional, config, {
+3 −1
Original line number Diff line number Diff line
@@ -5,8 +5,10 @@ module.exports = function(args) {
		_internFunctional = require('./_intern-functional')(args),
		_remote = require('./_remote')(args),

		serverUrl = args.serverUrl || 'https://appdev.redmic.net',

		config = {
			serverUrl: 'https://appdev.redmic.net'
			serverUrl: serverUrl
		};

	return deepmerge.all([_internFunctional, _remote, config], {