Skip to content

Commit

Permalink
update to support robot 2.8.1 and update version 1.2 while at it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jussimalinen committed Jun 16, 2013
1 parent 3adc017 commit 8f05fe2
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 22 deletions.
8 changes: 4 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Releasing

osx:
```bash
grep -rl 'sion>1.1</ver' ./ | xargs sed -i '' 's|sion>1.1</ver|sion>1.1.1</ver|g'
grep -rl 'sion>1.2</ver' ./ | xargs sed -i '' 's|sion>1.2</ver|sion>1.3</ver|g'
```
linux:
```bash
grep -rl 'sion>1.1</ver' ./ | xargs sed -i 's|sion>1.1</ver|sion>1.1.1</ver|g'
grep -rl 'sion>1.2</ver' ./ | xargs sed -i 's|sion>1.2</ver|sion>1.3</ver|g'
```
Last you should update those rows above.

Expand All @@ -51,8 +51,8 @@ mvn site:site
* Commit to git

```bash
git commit -am "version 1.0.4"
git tag 1.0.4
git commit -am "version 1.3"
git tag 1.3
git push
git push --tags
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add the plugin to your build:
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.1.1-SNAPSHOT</version>
<version>1.2</version>
<name>Robot Framework Maven Plugin</name>
<description>
Maven plugin for the Robot Framework.
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>robotframework</artifactId>
<version>2.7.7</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ private String[] generateRunArguments() {
generatedArguments.addNonEmptyStringToArguments(name, "-N");
generatedArguments.addNonEmptyStringToArguments(document, "-D");
generatedArguments.addNonEmptyStringToArguments(runMode, "--runmode");
generatedArguments.addFlagToArguments(dryrun, "--dryrun");
generatedArguments.addFlagToArguments(exitOnFailure, "--exitonfailure");
generatedArguments.addFlagToArguments(skipTeardownOnExit, "--skipteardownonexit");
generatedArguments.addNonEmptyStringToArguments(randomize, "--randomize");
generatedArguments.addNonEmptyStringToArguments(splitOutputs, "--splitoutputs");
generatedArguments.addNonEmptyStringToArguments(logTitle, "--logtitle");
generatedArguments.addNonEmptyStringToArguments(reportTitle, "--reporttitle");
Expand Down Expand Up @@ -287,6 +291,7 @@ private String[] generateRunArguments() {
xunitFile = new File("TEST-" + testCasesFolderName.replace(' ', '_') + ".xml");
}
generatedArguments.addFileToArguments(xunitFile, "-x");
generatedArguments.addFlagToArguments(true, "--xunitskipnoncritical");

generatedArguments.add(testCasesDirectory.getPath());

Expand Down Expand Up @@ -411,13 +416,46 @@ private String[] generateRunArguments() {
private List<String> nonCriticalTags;

/**
* Sets the execution mode for this tests run. Valid modes are ContinueOnFailure, ExitOnFailure,
* SkipTeardownOnExit, DryRun, and Random:&lt;what&gt;.
* Sets the execution mode for this tests run. Note that this setting has
* been deprecated in Robot Framework 2.8. Use separate dryryn,
* skipTeardownOnExit, exitOnFailure, and randomize settings instead.
*
* @parameter
*/
private String runMode;

/**
* Sets dryrun mode on use. In the dry run mode tests are run without
* executing keywords originating from test libraries. Useful for
* validating test data syntax.
*
* @parameter default-value="false"
*/
private boolean dryrun;

/**
* Sets whether the teardowns are skipped if the test
* execution is prematurely stopped.
*
* @parameter default-value="false"
*/
private boolean skipTeardownOnExit;

/**
* Sets robot to stop execution immediately if a critical test fails.
*
* @parameter default-value="false"
*/
private boolean exitOnFailure;

/**
* Sets the test execution order to be randomized. Valid values are all,
* suite, and test
*
* @parameter
*/
private String randomize;

/**
* Sets individual variables. Use the format "name:value"
*
Expand Down Expand Up @@ -742,4 +780,4 @@ public void run() {
} catch (IOException ioe) {
ioe.printStackTrace(); }
}
}
}
2 changes: 1 addition & 1 deletion src/site/apt/examples/javalibraries.apt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Using Java Libraries with the Robotframework Plugin
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<configuration>
<extraPathDirectories>
<extraPathDirectory>src/test/resources/python</extraPathDirectory>
Expand Down
19 changes: 16 additions & 3 deletions src/site/apt/index.apt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Robot Framework Maven Plugin
* {{{./run-mojo.html}robotframework:run}} - behaves like invoking the
{{{http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#starting-test-execution}jybot}}
Robot Framework command for executing test cases

* {{{./acceptance-test-mojo.html}robotframework:acceptance-test}} - Runs the tests, like the run-goal, but does not verify the test results.

* {{{./verify-mojo.html}robotframework:verify}} - Verifies the results from acceptance-test goal.

* {{{./libdoc-mojo.html}robotframework:libdoc}} invokes the
Expand Down Expand Up @@ -57,7 +57,7 @@ Robot Framework Maven Plugin
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -97,6 +97,19 @@ Robot Framework Maven Plugin
{{{./source-repository.html}source repository}} and will find supplementary information in the
{{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}.

* About memory usage

This plugin runs Robot Framework with Jython and in some cases parsing the
Robot's own output.xml can cause Jython to use excessive amounts of memory.

To avoid parsing the xml, you can disable log generation by the setting
logFile config to value NONE. This still allows Robot to generate the html
report, and the xunit output-file, which the plugin uses to verify the results
of the test run. The log-file can be generated later from the output.xml using
{{{http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#post-processing-outputs}rebot}}
tool if needed.


* Examples

To provide you with better understanding of some usages of the Robot Framework Maven Plugin,
Expand Down
4 changes: 2 additions & 2 deletions src/site/apt/transitioning.apt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Trasitioning from old version of Robot Framework Maven Plugin
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
</plugin>
+---

Expand All @@ -46,7 +46,7 @@ Trasitioning from old version of Robot Framework Maven Plugin
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<configuration>
<libdoc>
<libraryOrResourceFile>MyLib</libraryOrResourceFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public void testPomWithTestsConfigured() throws IOException, VerificationExcepti
assertFilePresent("target/robotframework-reports/TEST-acceptance.xml");
}

public void testVerificationIgnoresNonCritical() throws IOException, VerificationException {
cliOptions.add("-f");
cliOptions.add("pom_with_noncritical_failures.xml");
executeGoals(PLUGIN + ":acceptance-test",PLUGIN + ":verify");
assertFilePresent("target/robotframework-reports/TEST-acceptance.xml");
}

public void testPomWithTestsConfiguredOverridden() throws IOException, VerificationException {
cliOptions.add("-f");
cliOptions.add("pom_with_tests_configured.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public void testShouldSucceed()
mojo.execute();
}

public void testRunmodesShouldWork()
throws Exception {
File pom = getTestFile("src/test/resources/pom-runmodes.xml");
RobotFrameworkMojo mojo = (RobotFrameworkMojo) lookupMojo("run", pom);
mojo.execute();
}


public void testShouldSucceedWithExternalRunner()
throws Exception {
File pom = getTestFile("src/test/resources/pom-configure-runner.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public void testDontSkip()
robotFrameworkMojo.execute();

PowerMockito.verifyStatic();
RobotFramework.run(new String[]{"-x", "TEST-tests.xml", testsFolder});
RobotFramework.run(new String[]{"-x", "TEST-tests.xml", "--xunitskipnoncritical", testsFolder});
}
}
2 changes: 1 addition & 1 deletion src/test/projects/acceptance-and-verify/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Test Mojo</name>


<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>acceptance-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<criticalTags>
<criticalTag>success</criticalTag>
</criticalTags>
</configuration>
</plugin>
</plugins>
</build>
</project>



Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<executions>
<execution>
<goals>
Expand Down
32 changes: 32 additions & 0 deletions src/test/resources/pom-runmodes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Test Mojo</name>

<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<configuration>
<testCasesDirectory>src/test/resources/robot-fail</testCasesDirectory>
<outputDirectory>target/robotframework-reports</outputDirectory>
<xunitFile>TEST-robot-runmodes.xml</xunitFile>
<dryrun>true</dryrun>
<exitOnFailure>true</exitOnFailure>
<skipTeardownOnExit>true</skipTeardownOnExit>
<randomize>all</randomize>
</configuration>
</plugin>
</plugins>
</build>
</project>



0 comments on commit 8f05fe2

Please sign in to comment.