I can't run vertx module for eclipse project on windows 7
I have followed the instructions here: http://vertx.io/gradle_dev.html
download the template https://github.com/vert-x/vertx-gradle-template
run the tests
cd vertx-gradle-template-master
gradlew.bat test
BUILD SUCCESSFUL
setup the ide
gradlew.bat eclipse
BUILD SUCCESSFUL
trying to run module
gradlew.bat runMod
I got this:
:collectDeps UP-TO-DATE
:runMod
Module directory build\mods\com.mycompany~my-module~1.0.0-final already exists. Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information
on the replacement for dynamic properties.
Deprecated dynamic property: "args" on "task ':runMod'", value: "[runmod, com.mycompany...".
Building 50% > :runMod
What I should do with this? I don't understand.
Actually, you got everything working!
The dev guide [0] provides the extra information you need. According to it, Gradle swallows INFO-level messages from the program. If you do it again with '-i', then you will see the missing output that actually indicates things are working as expected.
Here's what I see when I run ./gradlew runmod -i (note that case doesn't matter, this works same as using 'runMod'), where you can see the log message from the PingVerticle class indicating it's waiting for ping messages:
...Same output as from the question...
PingVerticle started
Succeeded in deploying module
> Building 50% > :runMod
Unfortunately, the documentation is sorely lacking and the PingVerticle will just sit there indefinitely until you actually send a ping message yourself.
[0] http://vertx.io/dev_guide.html
Related
Hi StackoverFlow folks,
The below error is really eating my head and I am not able to understand whats the mistake I have made. Hence looking forward to communities help.
Command and error
home:tcr-ui-automation sobhit.sharma$ gradle clean build -Denv=QA '-Dcucumber.options=--tags #target/rerun.txt'
Task :test
runners.TestRunner STANDARD_OUT None of the features at [classpath:features] matched the filters: [#target/rerun.txt]
0 Scenarios
0 Steps
0m0.000s
`
The cucumber option is something like this where I have defined my options-
#RunWith(Cucumber.class)
#CucumberOptions(
features = "classpath:features",glue = "stepDefinations",
plugin = { "com.cucumber.listener.ExtentCucumberFormatter:",
"junit:target/cucumber-results.xml",
"rerun:target/rerun.txt"},
tags="#Smoke",
monochrome = true
)
public class TestRunner {
Goal is to run the failed scenarios of a feature file.
File structure-
When dealing with errors that don't seem to make sense, it often helps to read every part of the command and error message out loud and in detail. Think if it as carefully explaining what you are doing to a co-worker.
For example:
gradle clean build -Denv=QA '-Dcucumber.options=--tags #target/rerun.txt'
Here you are telling gradle to clean the build environment. After cleaning the build environment to build the project. When doing so a JVM flag is passed to set the environment to QA and a JVM flag is passed to tell Cucumber to run only scenarios that are tagged with #target/rerun.txt.
When executing this:
None of the features at [classpath:features] matched the filters: [#target/rerun.txt]
Now Cucumber complains that it looked for features on the classpath but none were tagged with #target/rerun.txt.
I would like to make a build pipeline in Azure DevOps including tests/code coverage.
For that, I created a very basic Java project:
package main:
- main class
- Calculator class
- add method
package test:
- CalculatorTest class
- addTest method
It's very basic, just for me to understand how test in pipeline work. I don't use maven or things like that. For the tests, I'm using JUnit framework.
In Azure DevOps pipeline, I imported my project from Github, and started to create the pipeline. I start from the starter template, which contains:
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
My question is:
What do I have to do to run my tests automatically ?
I've seen several examples on the Microsoft documentation but it was always for "complex" projects (like with maven etc.). And ass I'm new with Azure DevOps and YAML file/syntax, I'm lost.
I want to run my tests after each commit, and see the results (test + code coverage) in the pipeline summary, like it is described here : https://learn.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops#view-test-results-in-build
Thanks a lot.
PS: For the moment I'm just focusing on tests but once it will be done I also would like to publish build artefacts. I would like the confirmation of that:
- task: PublishBuildArtifacts#1
Is that line correct ?
EDIT
The line - task: PublishBuildArtifacts#1 seems to work correclty but I have the following warning:
Directory '/home/vsts/work/1/a' is empty. Nothing will be added to build artifact 'drop'.
What does it mean ?
Finally I used the visual designer (like explained here: https://learn.microsoft.com/en-US/azure/iot-edge/how-to-ci-cd) and I added the Maven task.
I upgraded my project to use Maven, which is well integrated in Azure Devops.
I am running a spring integration test using maven. I am trying to run it with debug port enabled so that I can attach to it from IntelliJ idea.
The following command line used to work in the past. It used to allow the surefire bootup to initialize, and then wait to attach to port 8000 before continuing with the test:
-Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" -DtestIntegration test
However this is now giving me the following exception:
[ERROR] No plugin found for prefix 'runjdwp' in the current project and in the plugin groups [com.zillow, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/ferozed/.m2/repository-p4), nexus (http://repo.zillow.local/content/groups/public)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'runjdwp' in the current project and in the plugin groups [com.zillow, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/ferozed/.m2/repository-p4), nexus (http://repo.zillow.local/content/groups/public)]
at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:260)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
Any ideas how I can get this to work?
I remember dealing with this before. The debug options you are using may have been deprecated in your version of Java. Java 5 and under used -Xrunjdwp. I believe Java 7 and up (not sure about 6, used both?) use agentlib:jdwp. I recommend checking out this answer on SO.
https://stackoverflow.com/a/173447/50558
None of the plugin approaches (-Xrunjdwp, or -Xagentlib ) worked for me.
So, I gave up and ran the test with -DforkMode=never for the surefire plugin, and that made sure that the test ran in-process with the maven execution. Then I could attach to the process.
I have read elsewhere that this is not safe, as the classpath of the invocation might get shared with the classpath of the test, but I could not find any other way to make my scenario work.
I followed the documentation for using app.yaml with Java which claims that this should work and that it will generate web.xml and appengine-web.xml automatically. However, it doesn't seem to work and it doesn't mention which tool will generate the files.
I first tried a mvn clean install which errors out because the .xml files are missing:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project roger-analytics: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
I then tried to run the local development server:
$ gcloud preview app run app.yaml
ERROR: (gcloud.preview.app.run) An error occurred while parsing file: [/Users/blixt/src/roger-api/module_analytics/app.yaml]
Unexpected attribute 'servlet' for object of type URLMap.
in "/Users/blixt/src/roger-api/module_analytics/app.yaml", line 7, column 12
(I get the same error from dev_appserver.py . by the way)
It appears that app.yaml isn't supported after all. Am I missing something, or was support removed without updating the documentation?
Here's my app.yaml file, which is intended to run as a module in my Google Cloud App Engine project (along with other modules that have Python and Go runtimes):
module: analytics
runtime: java
api_version: 1
handlers:
- url: /*
servlet: im.rgr.roger.RogerAnalytics
login: admin
secure: always
system_properties:
java.util.logging.config.file: WEB-INF/logging.properties
There are several issues at play here. I'll describe various facts that group together to create a constellation of SDK edge-case goodness (this information is current as of SDK 1.9.21):
In order to deploy using the Java SDK's appcfg.sh, you'll need to have app.yaml inside the war/WEB-INF/ folder.
appcfg.py complains Unexpected attribute 'servlet' for object of type URLMap..
gcloud preview app deploy uses appcfg.py (or the same codebase) and therefore also complains in the same manner
So, in conclusion, you'll need to use appcfg.sh
After all the successful steps of my Jenkins build I get an error:
Recording test results
"ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
hudson.AbortException: No test report files were found. Configuration error?"
I tried to search the answer in Jenkins documentation and on stack-overflow, however I didn't find any answer.
If you use behat3, then make sure that its version has junit formatter support, as it was missed in early versions https://github.com/Behat/Behat/pull/676
Also check that you have configured profile at behat.yml
behat 2
jenkins:
formatter:
name: pretty,junit
parameters:
output_path: ,build/logs/behat
behat 3
jenkins:
formatters:
junit: [build/log/behat]
Also build.xml must call it as "behat --profile jenkins"
I may assume that you have configured your test result path not to be related to Jenkins workspace (usually, this is the directory which you run tests from). JUnit result xml path should be configured in relation with Jenkins workspace directory, which is the root directory for you xml reports.