GUACAMOLE-1765: Use maven-frontend-plugin instead of jasmine-frontend-plugin to fix docker build.

This commit is contained in:
James Muehlner
2023-04-06 18:44:37 +00:00
parent 8a319eb908
commit a765e34488
6 changed files with 2854 additions and 13 deletions

View File

@@ -1,2 +1,4 @@
node/*
node_modules/*
target/
*~

View File

@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module.exports = function(config) {
config.set({
// Discover and run jasmine tests
frameworks: ['jasmine'],
// Pattern matching all javascript source and tests
files: [
'src/**/*.js'
],
// Run the tests once and exit
singleRun: true,
// Disable automatic test running on changed files
autoWatch: false,
// Use a headless chromium browser to run the tests
// --no-sandbox required when running in docker build - for more, see
// https://github.com/karma-runner/karma-chrome-launcher/issues/158
// TODON'T: THIS
browsers: ['ChromiumHeadlessNoSandbox'],
customLaunchers: {
ChromiumHeadlessNoSandbox: {
base: 'ChromiumHeadless',
flags: ['--no-sandbox']
}
}
})
}

2752
guacamole-common-js/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
{
"description": "Dependencies to be installed by maven for running JS tests",
"devDependencies": {
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-jasmine": "^5.1.0"
}
}

View File

@@ -116,25 +116,51 @@
<!-- Unit test using Jasmin and PhantomJS -->
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>2.2</version>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<!-- The version of node to use for running tests -->
<nodeVersion>v16.19.1</nodeVersion>
<!-- Install dependencies with "npm ci" for repeatability -->
<arguments>ci</arguments>
<!-- The location of the karma config file -->
<karmaConfPath>karma-ci.conf.js</karmaConfPath>
</configuration>
<executions>
<!-- Install node.js and NPM before running tests -->
<execution>
<id>install node and npm</id>
<goals>
<goal>test</goal>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<!-- Install test dependencies -->
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<!-- Run all tests non-interactively -->
<execution>
<id>run tests</id>
<goals>
<goal>karma</goal>
</goals>
</execution>
</executions>
<configuration>
<phantomjs>
<version>2.1.1</version>
</phantomjs>
<sourceIncludes>
<sourceInclude>**/*.min.js</sourceInclude>
</sourceIncludes>
<jsSrcDir>${project.build.directory}/${project.build.finalName}</jsSrcDir>
</configuration>
</plugin>
</plugins>