Giter Site home page Giter Site logo

karma-gradle's Introduction

Karma Gradle Plugin

This Gradle plugin allows you to run Jasmine, Qunit, or Mocha tests using the Karma test runner.

Getting Started

plugins {
    id 'com.craigburke.karma' version '1.4.4'
}

Tasks

The plugin adds the following tasks to your build:

Task

Description

karmaRun

Runs your tests

karmaWatch

Runs your tests in watch mode

karmaRefresh

Refresh the generated karma config file

karmaClean

Deletes the karma config file and removes the dependencies

Configuration

Properties

You can use the same properties you’d set in your karma.config.js file directly in build.gradle

plugins {
    id 'com.craigburke.karma' version '1.4.4'
}

karma {
    basePath = 'src/assets' // <1>
    colors = true // <2>
    profile 'angularJS' // <3>

    browsers = ['PhantomJS'] // <4>
    frameworks = ['jasmine'] // <5>
    reporters = ['junit'] // <6>
}
  1. Optional base path for resolving relative paths

  2. Whether to show colors on the screen (default is true)

  3. File pattern profile to use. Possible values: default, angularJS

  4. Runs tests in the browsers listed here and installs the launcher dependencies. Possible values: PhantomJS, Firefox, Chrome, ChromeCanary, Opera, Internet Explorer, Safari

  5. Uses the listed frameworks and installs their dependencies. Possible values: jasmine, mocha, qunit.

  6. Uses additional reporters and installs their dependencies. Possible values: progress, junit, coverage, growl, teamcity

Note
if basePath is not set, it defaults the project root.

Profiles

Profiles allow you to use commonly used file patterns and sensible defaults for the files list. Currently there is a default and an angularJS profile.

plugins {
    id 'com.craigburke.karma' version '1.4.4'
}

karma {
    profile 'angularJS'  // <1>
}
  1. Applying the angularJS profile

For any profile, the files to be loaded are broken into three groups (libraries, source and tests). You can override the base path and file pattern list for any of these groups within a profile. This can be useful if the order that the files are loaded in matters.

karma {
    profile('default')  {
        libraryBases = ['**/libs/']
        libraryFiles = ['jquery.js', 'lib1.js'] // <1>

        sourceBases = ['src/', 'app/']
        sourceFiles = ['source1.js', '**/*.js'] // <2>

        testBases = ['tests/']
        testFiles = ['**/*test.js'] // <3>
    }
}
  1. Overriding both the base path and list of library files. This will add /libs/**/jquery.js and /libs/**/lib1.js to the start of the karma files list

  2. Overriding both the base path and list of source files. This will add src/source1.js, app/source1.js, src/**/*.js and app/**/*.js to the files list after the library files.

  3. Overriding both the base path and list of test files. This will add /tests/**/*test.js to the files list after the source files.

Note
you can always build your own files list by setting the files property directly (see Advanced Configuration).

Dependencies

By default the plugin will automatically install all needed browser, framework and reporter dependencies. If you need to add an additional npm dependency you can set it using the dependencies method.

karma {
    dependencies(['karma-sinon'])
}

You can also lock any dependency to a specific version by adding it this way with @ version syntax:

karma {
    dependencies(['[email protected]'])
}

Advanced Configuration

In addition to the properties listed above, you can also include set other Karma properties through the DSL.

karma {
    files = [
        'bower/angular/angular.js',
        '**/!(*.spec).js',
        '**/*.spec.js'
    ]

    exclude = ['jquery.js']
    junitReporter = [outputDir: 'test-dir' ]
}

karma-gradle's People

Contributors

craigburke avatar iainduncani avatar jameskleeh avatar testinfected avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

karma-gradle's Issues

Why is the new version is not published?

The current version 1.4.4 doesn't work with the newest version of gradle-node-plugin. And it's already fixed in master, but is not published to Gradle plugin repository yet. Is there any problem to publish?

:karmaRun failing while building the gradle project

E:\MyWorkspace\Expirements\Gradle_Karma>gradlew build
:compileJava UP-TO-DATE
:processResources NO-SOURCE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:karmaInit UP-TO-DATE
:nodeSetup UP-TO-DATE
:karmaDependencies UP-TO-DATE
:karmaGenerateConfig UP-TO-DATE
:karmaRun
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
:karmaRun FAILED56% EXECUTING

:karmaRun
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':karmaRun'.

Process 'command 'cmd'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

Total time: 10.982 secs

E:\MyWorkspace\Expirements\Gradle_Karma>

Execution failed for task ':karmaRun'.

I am using Gradle 2.13 and version 1.4.3 of this plugin. When I try to run a JavaScript test, I get this error:

Execution failed for task ':objectaid-update-site:karmaRun'.
Process 'command 'cmd'' finished with non-zero exit value 1

Is there any way to get more information about the actual source of the problem?

Unable to unpack phantomjs archive at Linux

I use PhantomJS to run E2E tests. I've found that the tests have started failing at phantomjs archive unpacking step. I've not changed the configuration (I used karma-gradle 1.4.1). I've tried to switch to the latest version: 1.4.3. The error is still reproduced:

:karmaDependenciesError extracting archive
Phantom installation failed { [Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
]
  killed: false,
  code: 2,
  signal: null,
  cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
Error extracting archive
Phantom installation failed { [Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
]
  killed: false,
  code: 2,
  signal: null,
  cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
 FAILED

It looks like this issue is very similar to Medium/phantomjs#467. I understand that the root cause is most likely not in karma-gradle plugin itself (maybe some dependency version update will be needed). But I'm not an expert in front end development, so I was not able follow a chain of dependencies to find out the root cause and propose a fix.

How to serve fixtures using file patterns?

Hi,
Thank you for building this fantastic plugin!
I've been trying out this in a project and I've managed to include JS files necessary, but not fixtures.

This is what my "files" setting in my.conf.js for karma looks like:
// list of files / patterns to load in the browser files: [ 'js/tests/lib/jquery.js', 'js/tests/spec/javascripts/helpers/jasmine-jquery.js', 'js/modules/initFixtures.js', 'js/modules/module.js', 'js/tests/spec/javascripts/default-spec.js', { pattern: 'js/tests/spec/javascripts/fixtures/index.html', included: false, served: true, watched:true } ],

How do I replicate the same in my build.gradle file? I need to serve the HTML file as a fixture and if I include it like other JS files int the list, the tests don't work they should. My tests run when I directly call karma, but not when I run from gradle.

basePath computed from `build` dir

I was running into problems with the plugin reporting ERROR.

:karmaDependencies (Thread[Task worker Thread 3,5,main]) completed. Took 48.84 secs.
:karmaRun (Thread[Daemon worker Thread 5,5,main]) started.
:karmaRun
Executing task ':karmaRun' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
Starting process 'command '/Users/rahul/.gradle/nodejs/node-v4.2.2-darwin-x64/bin/node''. Working directory: /Users/rahul/src/hottowel-ratpack Command: /Users/rahul/.gradle/nodejs/node-v4.2.2-darwin-x64/bin/node /Users/rahul/src/hottowel-ratpack/node_modules/karma/bin/karma start /Users/rahul/src/hottowel-ratpack/build/karma.conf.js --single-run
Successfully started process 'command '/Users/rahul/.gradle/nodejs/node-v4.2.2-darwin-x64/bin/node''
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.006 secs / 0 secs)

I modified the karma.conf.js to set logLevel to DEBUG. This is one of the things it would be nice if the plugin allowed.

Then I saw that it was computing basePath from the build dir onwards.

02 12 2015 10:31:00.887:DEBUG [plugin]: Loading plugin /Users/rahul/src/hottowel-ratpack/node_modules/karma-jasmine.
02 12 2015 10:31:00.889:DEBUG [plugin]: Loading plugin /Users/rahul/src/hottowel-ratpack/node_modules/karma-junit-reporter.
02 12 2015 10:31:00.953:DEBUG [plugin]: Loading plugin /Users/rahul/src/hottowel-ratpack/node_modules/karma-phantomjs-launcher.
02 12 2015 10:31:01.070:WARN [watcher]: Pattern "/Users/rahul/src/hottowel-ratpack/build/src/assets/bower/**/*.js" does not match any file.
02 12 2015 10:31:01.071:WARN [watcher]: Pattern "/Users/rahul/src/hottowel-ratpack/build/src/assets/js**/!(*.spec).js" does not match any file.
02 12 2015 10:31:01.072:WARN [watcher]: Pattern "/Users/rahul/src/hottowel-ratpack/build/src/assets/js**/*.spec.js" does not match any file.
02 12 2015 10:31:01.084:INFO [karma]: Karma v0.13.15 server started at http://localhost:9876/
02 12 2015 10:31:01.096:INFO [launcher]: Starting browser PhantomJS
02 12 2015 10:31:01.097:DEBUG [temp-dir]: Creating temp dir at /var/folders/3z/70s6csl91dj6m9r1360pvmdw0000gr/T/karma-66054161
02 12 2015 10:31:01.101:DEBUG [launcher]: /Users/rahul/src/hottowel-ratpack/node_modules/phantomjs/lib/phantom/bin/phantomjs /var/folders/3z/70s6csl91dj6m9r1360pvmdw0000gr/T/karma-66054161/capture.js

Workaround:

  basePath = '../src/assets'

Any update of this project?

Hi, I found your idea of having Karma plugin integrated to Gradle build excellent. But the project has not been updated for quite a while. Is it still being actively supported ??

:karmaDependencies'node' is not recognized as an internal or external command,

Using git bash, and using gradle (wrapper) version 3.1, on Windows 7, I get this issue.

If I run gradlew.bat from a regular cmd window, the tests run and complete.

:compileJava
:processResources
:classes
:karmaInit UP-TO-DATE
:nodeSetup
:karmaDependencies'node' is not recognized as an internal or external command,
operable program or batch file.
'node' is not recognized as an internal or external command,
operable program or batch file.
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':karmaDependencies'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 58.115 secs

Command line parameters

Karma supports parameters on the command line to change how it runs for a given execution.

Example: karma run -- --grep=testDescriptionFilter

Ideally it would be supported to pass parameters via the gradle task that can delegated to Karma

karmaRun task is always running

Hi,

When I am running karmaRun the task is never being detected as up-to-date and therefore always executing even though nothing has changed

Unable to setup preprocessors

I'm trying to use this plugin for testing a typescript project. In doing so, I need to add karma-typescript framework and setup karma to use it for compiling typescript. I'm using this simple file:


module.exports = function (config) {
   config.set({
      basePath : 'src/test/',
      files : [
         {pattern: '**/*.ts'}
      ],
      colors : true,
      frameworks: ['jasmine','karma-typescript'],
      preprocessors : {
            '**/*.ts' : ['karma-typescript']
      },    
      browsers : ['PhantomJS'],    
      reporters : ['progress'],   
   });
}

The problem is that when I try to put this same configuration in gradle in order to use your plugin, like this:

preprocessors = {
    'src/main/**/*.ts' = ['karma-typescripts']
}

Gradle complains about the syntax of the preprocessor directive

[src/main/**/*.ts] is a constant expression, but it should be a variable expression at line: 25 column: 26. File: _BuildScript_ @ line 25, column 26.
           'src/main/**/*.ts' = ['karma-typescripts'] 

I have tried several options, but none works. I would appreciate if you could help me with this issue, either by indicating how correctly setup this in the gradle file, or how to include it from an external karma config file.

karmaDependencies fails to install phantomjs while behind auth-proxy

Unforntunately, according to Medium/phantomjs#399 there are problems with phantomjs when behind a proxy.

Starting process 'command '/home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/bin/node''. Working directory: /home/schmittr/projects/eers-new/app Command: /home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/bin/node /home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/lib/node_modules/npm/bin/npm-cli.js install karma karma-phantomjs-launcher phantomjs karma-jasmine --silent
Successfully started process 'command '/home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/bin/node''
:app:karmaDependencies FAILED
:app:karmaDependencies (Thread[Daemon worker Thread 3,5,main]) completed. Took 22.419 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:karmaDependencies'.
> Process 'command '/home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/bin/node'' finished with non-zero exit value 1

The installation of karma karma-jasmine without phantomjs works though.
The installation of phantomjs/karma-phantomjs-launcher throws following error:

> [email protected] install /home/schmittr/projects/eers-new/app/node_modules/phantomjs
> node install.js

Install exited unexpectedly
npm ERR! Linux 4.1.15-1-MANJARO
npm ERR! argv "/home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/bin/node" "/home/schmittr/.gradle/nodejs/node-v4.2.3-linux-x64/lib/node_modules/npm/bin/npm-cli.js" "install" "phantomjs"
npm ERR! node v4.2.3
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/schmittr/projects/eers-new/app/npm-debug.log

Ability to use karma.conf.js

Currently it is generated by plugin. In case of migrating from old project with big karma conf file. It will be helpfull

Gradle Karma Test Case

I am running karma test case using gradle. I am getting the below issue.
* No such property: files for class: com.moowork.gradle.node.task.NodeTask_Decorated*

Here is my build.gradle file

buildscript {
repositories {

jcenter()
mavenCentral()
maven {
        url "https://plugins.gradle.org/m2/"
    }

}

dependencies {
classpath "com.eriwen:gradle-js-plugin:1.12.1"

}
}

plugins {

id 'com.craigburke.karma' version '1.4.3'   

}

apply plugin: "com.eriwen.gradle.js"

karmaRun{

files= [
        //'JASMINE',
        //'JASMINE_ADAPTER',
        'test/lib/angular/angular.js',
        'test/lib/angular/angular-mocks.js',
        'test/lib/mock-ajax.js',
        'app/lib/bootstrap/*.js',
        'app/lib/edmDataManager.js',
        'app/lib/edmDataDefinition.js',
        'app/lib/dataMappingFramework.js',


        'test/unit/*.spec.js'


    ]

junitReporter = [outputDir: 'test-dir' ]

}

defaultTasks 'karma'

Specified dependency not installed

Example config:

karma {

    dependencies(['karma-wrap-preprocessor'])

    profile 'angularJS'

    preprocessors = [
        'grails-app/assets/javascripts/**/*.js': ['wrap']
    ]

    wrapPreprocessor = [
        template: "(function () { 'use strict';  <%= contents %> })()"
    ]
}

The karma-wrap-preprocessor is not included in my node_modules folder. Grails 3.1.0.RC2

Need steps to pull it to local Archiva

Hello,

Hope you are doing well and thanks for the wonderful plugin which is making our life easier.

I want to get the project in our local archiva but can't find it on Maven repo (I see some your other projects). Will you be able to help me with this?

Thanks,

Aninda

Unable to execute karmaRun task

Hi,

I'm trying to use your plugin in my gradle project. I've applied the plugin and took defaults like suggested in the doc, but when I run gradlew karmaRun, it fails with the following exception during the nodeSetup task:

Caused by: java.io.FileNotFoundException: C:\Users\mike.gradle\nodejs\node-v4.2.3-windows-x64\bin\node.exe (The process cannot access the file because it is being used by another process)

I'm using Gradle 2.9. Any ideas?

stacktrace.txt

karmaDependencies task doesn't update changed dependencies

karmaDependencies task is UP-TO-DATE even after changing something in karma { dependencies }.

So if you want to be sure that you have dependencies mentioned in your config downloaded, you have to always execute karmaClean beforehand, and then redownload all dependencies afresh.

karmaRun if failing due to dependency error on windows

Selected primary task 'karmaRun' from project :
Tasks to be executed: [task ':JavaScriptTesting:karmaInit', task ':JavaScriptTesting:nodeSetup', tas
k ':JavaScriptTesting:karmaDependencies', task ':JavaScriptTesting:karmaGenerateConfig', task ':Java
ScriptTesting:karmaRun']
:JavaScriptTesting:karmaInit (Thread[main,5,main]) started.
:JavaScriptTesting:karmaInit
Skipping task ':JavaScriptTesting:karmaInit' as it has no actions.
:JavaScriptTesting:karmaInit UP-TO-DATE
:JavaScriptTesting:karmaInit (Thread[main,5,main]) completed. Took 0.018 secs.
:JavaScriptTesting:nodeSetup (Thread[main,5,main]) started.
:JavaScriptTesting:nodeSetup
Skipping task ':JavaScriptTesting:nodeSetup' as it is up-to-date (took 0.007 secs).
:JavaScriptTesting:nodeSetup UP-TO-DATE
:JavaScriptTesting:nodeSetup (Thread[main,5,main]) completed. Took 0.019 secs.
:JavaScriptTesting:karmaDependencies (Thread[main,5,main]) started.
:JavaScriptTesting:karmaDependencies
Executing task ':JavaScriptTesting:karmaDependencies' (up-to-date check took 0.002 secs) due to:
No history is available.
Starting process 'command 'cmd''. Working directory: C:\workspace\current\wm_rma\JavaScriptTesting C
ommand: cmd /c ""C:\Users\Administrator.gradle\nodejs\node-v4.2.3-windows-x64\bin\node.exe" "C:\Use
rs\Administrator.gradle\nodejs\node-v4.2.3-linux-x86\lib\node_modules\npm\bin\npm-cli.js" "install"
"--silent" "karma" "karma-chrome-launcher" "karma-jasmine" "jasmine-core""
Successfully started process 'command 'cmd''
:JavaScriptTesting:karmaDependencies FAILED
:JavaScriptTesting:karmaDependencies (Thread[main,5,main]) completed. Took 1.185 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':JavaScriptTesting:karmaDependencies'.

    Process 'command 'cmd'' finished with non-zero exit value 1


    stacktrace:

:JavaScriptTesting:karmaDependencies FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':JavaScriptTesting:karmaDependencies'.

    Process 'command 'cmd'' finished with non-zero exit value 1

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':JavaScriptTesting:karmaDepe
    ndencies'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(Execute
    ActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActions
    TaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExe
    cutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTask
    Executer.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExec
    uter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmpt
    ySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWit
    hNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExec
    uter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMo
    stOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:
    306)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(Ab
    stractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(Ab
    stractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTa
    skPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.ja
    va:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.
    java:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java
    :29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:3
    2)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:
    149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProces
    sBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute
    r.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute
    r.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineA
    ctionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineA
    ctionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.j
    ava:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.j
    ava:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFac
    tory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFac
    tory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33
    )
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22
    )
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    Caused by: org.gradle.process.internal.ExecException: Process 'command 'cmd'' finished with non-zero
    exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(Defaul
    tExecHandle.java:365)
    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31)
    at org.gradle.api.internal.file.DefaultFileOperations.exec(DefaultFileOperations.java:151)
    at org.gradle.api.internal.project.AbstractProject.exec(AbstractProject.java:780)
    at org.gradle.api.internal.project.AbstractProject.exec(AbstractProject.java:776)
    at org.gradle.api.Project$exec$20.call(Unknown Source)
    at com.moowork.gradle.node.exec.ExecRunner.run(ExecRunner.groovy:43)
    at com.moowork.gradle.node.exec.NodeExecRunner.doExecute(NodeExecRunner.groovy:44)
    at com.moowork.gradle.node.exec.ExecRunner.execute(ExecRunner.groovy:83)
    at com.moowork.gradle.node.exec.ExecRunner$execute.call(Unknown Source)
    at com.moowork.gradle.node.exec.NpmExecRunner.doExecute(NpmExecRunner.groovy:37)
    at com.moowork.gradle.node.exec.ExecRunner.execute(ExecRunner.groovy:83)
    at com.moowork.gradle.node.exec.ExecRunner$execute.call(Unknown Source)
    at com.moowork.gradle.node.task.NpmTask.exec(NpmTask.groovy:74)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA
    ction.doExecute(AnnotationProcessingTaskFactory.java:218)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA
    ction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA
    ction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteA
    ctionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(Execute
    ActionsTaskExecuter.java:61)
    ... 47 more

BUILD FAILED

Total time: 26.959 secs

C:\workspace\current>

Issuees while gradle project build process

Hi,

I am trying to use the below karma-gradle,
plugins {
id 'com.craigburke.karma' version '1.4.3'
}

https://plugins.gradle.org/plugin/com.craigburke.karma

I am getting below errors, please help me out this for getting appropriate solution.

  • What went wrong:
    Could not compile build file 'C:\develop\ISG\karma-gradle-master\build.gradle'.

    startup failed:
    Could not instantiate global transform class org.spockframework.compiler.SpockTransform specified at jar:file:/C:/.gradle/caches
    /modules-2/files-2.1/org.spockframework/spock-core/0.7-groovy-1.8/3a677d19e8d3acf3bd296c4023356256d55da5a3/spock-core-0.7-groovy-1
    .8.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception org.spockframework.util.Incompatib
    leGroovyVersionException: The Spock compiler plugin cannot execute because Spock 0.7.0-groovy-1.8 is not compatible with Groovy 2.
    3.10. For more information, see http://versioninfo.spockframework.org
    Spock location: file:/C:/.gradle/caches/modules-2/files-2.1/org.spockframework/spock-core/0.7-groovy-1.8/3a677d19e8d3acf3bd296c402
    3356256d55da5a3/spock-core-0.7-groovy-1.8.jar
    Groovy location: file:/C:/.gradle/wrapper/dists/gradle-2.4-bin/1lebsnfoptv8qpa10w6kyy5mp/gradle-2.4/lib/groovy-all-2.3.10.jar

    1 error

I have following environment,

In our application we are using jre1.8 and jdk1.6
We don't have node setup in our application
We are using gradle version 2.13-4.0

If above plugin that we used is not compatible with our environment.
I can not upgrade java environment can you please suggest me compatible version of this plugin.

License

I'm afraid not having a license is preventing me from adopting this plugin. Having no license actually prevents anyone from doing anything with this without your written permission.

If it is truly missing could I request you add one?

karmaDependencies fails using QUnit

karmaDependencies fails after trying to execute the command:

node npm-cli.js install --silent karma karma-phantomjs-launcher phantomjs karma-qunit qunitjs karma-junit-reporter

The error is:

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants qunitjs@^1.14.0

Protractor

Hi,

I'm using grails 3 which uses your Karma/bower plugins.

Im looking to introduce Angular's 'Protractor' testing framework into my grails 3 proj so that I can perform some full end to end tests.

Any idea how I could do this easily with your plugin ? thanks

How to prevent node download or override default version

Is there some way to allow karma to use the version of node that is installed locally, rather than downloading v4.2.3? I can see that you set various options here but I don't see any way to override them.

My build is currently failing because one of the libraries I depend on uses some ES6 syntax that node v4 doesn't understand, so I either need to have the build download a more recent node version, or use the local install.

karmaRefresh cleaning entire node_modules folder

Hi, when running the karmaRefresh task (which depends on karmaClean), the entire node_modules folder is being cleaned.
This is not very efficient in CI environments, because it causes the CI system to have to reload all node modules on every build.
By looking at the code, it seems the issue could be caused by: https://github.com/craigburke/karma-gradle/blob/master/src/main/groovy/com/craigburke/gradle/KarmaPlugin.groovy#L98

I'm guessing that replacing it with file should fix it.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.