RESOStandards / web-api-commander

Client tools and libraries to work with and test RESO Web APIs.
https://commander.reso.org
Other
37 stars 18 forks source link

Unable to run testDataDictionary_1_7 with the given command line #109

Closed pranedon closed 2 years ago

pranedon commented 2 years ago

Getting below error whenever I use './gradlew testDataDictionary_1_7 -DpathToRESOScript=/path/to/dd17.resoscript -DshowResponses=true -Dstrict=true' commands, it requires additional Tag - '-Dcucumber.filter.tags="@Property"' to run successfully. Am I missing something?

4 actionable tasks: 1 exe./gradlew testDataDictionary_1_7 -DpathToRESOScript=D:/web-api-commander/resoscripts/test.resoscript -DshowResponses=true -Dstrict=true

Task :testDataDictionary_1_7 FAILED Usage: java io.cucumber.core.cli.Main [options] [ [DIR|DIR URI] | [ [FILE|FILE URI][:LINE]* ] | @[FILE|FILE URI] ]+

Options:

  --threads COUNT                      Number of threads to run tests under.
                                       Defaults to 1.

-g, --glue PATH Package to load glue code (step definitions, hooks and plugins) from e.g: com.example.app. When not provided Cucumber will search the classpath.

-p, --plugin PLUGIN[:[PATH|[URI [OPTIONS]]] Exception in thread "main" Register a plugin. Built-in PLUGIN types: html, json, junit, message, pretty, progress, rerun, summary, teamcity, testng, timeline, usage, unused

                                       PLUGIN can also be a fully
                                       qualified class name, allowing
                                       registration of 3rd party plugins.

                                       If a http:// or https:// URI is used,
                                       the output will be sent as a PUT
                                       request. This can be overridden by
                                       providing additional options.

                                       OPTIONS supports cUrls -X and -H
                                       commands.

-t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION.

-n, --name REGEXP Only run scenarios whose names match REGEXP.

-d, --[no-]dry-run Skip execution of glue code.

-m, --[no-]monochrome Don't colour terminal output.

  --snippets [underscore|camelcase]    Naming convention for generated
                                       snippets. Defaults to underscore.

io.cucumber.core.exception.CucumberException: Missing argument for --tags -v, --version Print version.

-h, --help You're looking at it.

  --i18n LANG                          List keywords for in a particular
                                       language
                                       Run with "--i18n help" to see all
                                       languages

    at io.cucumber.core.options.CommandlineOptionsParser.removeArgFor(CommandlineOptionsParser.java:197)    
    at io.cucumber.core.options.CommandlineOptionsParser.parse(CommandlineOptionsParser.java:121)
    at io.cucumber.core.options.CommandlineOptionsParser.parse(CommandlineOptionsParser.java:86)
    at io.cucumber.core.cli.Main.run(Main.java:70)
    at io.cucumber.core.cli.Main.main(Main.java:30)

-w, --wip Fail if there are any passing scenarios.

  --order                              Run the scenarios in a different
                                       order. The options are 'reverse' and
                                       'random'. In case of 'random' order
                                       an optional seed parameter can be
                                       added 'random:<seed>'.

  --count                              Number of scenarios to be executed.
                                       If not specified all scenarios are
                                       run.

  --object-factory CLASSNAME           Uses the class specified by CLASSNAME
                                       as object factory. Be aware that the
                                       class is loaded through a service
                                       loader and therefore also needs to
                                       be specified in:
                                       META-INF/services/io.cucumber.core.backend.ObjectFactory

Feature path examples: When no feature path is provided cucumber will scan the classpath root and its sub directories.

Load the files with the extension ".feature" for the directory and its sub directories. /.feature Load the feature file /.feature from the file system. classpath:/.feature Load the feature file /.feature from the classpath. /.feature:3:9 Load the scenarios on line 3 and line 9 in the file /.feature. @/ Load / from the file system and parse feature paths generated by the rerun formatter. Properties, Environment variables and System properties: Cucumber will in order of precedence parse properties from system properties, environment variables and the `cucumber.properties` file. Note that options provided by `@CucumberOptions` takes precedence over the properties file and CLI arguments take precedence over all. Supported properties are: ``` cucumber.ansi-colors.disabled= # true or false. default: false cucumber.execution.dry-run= # true or false. default: false cucumber.execution.limit= # number of scenarios to execute (CLI only). cucumber.execution.order= # lexical, reverse, random or random:[seed] (CLI only). default: lexical cucumber.execution.wip= # true or false. default: false. # Fails if there any passing scenarios # CLI only. cucumber.features= # command separated paths to feature files. # example: path/to/example.feature, path/to/other.feature cucumber.filter.name= # a regular expression # only scenarios with matching names are executed. # example: ^Hello (World|Cucumber)$ cucumber.filter.tags= # a cucumber tag expression. # only scenarios with matching tags are executed. # example: @Cucumber and not (@Gherkin or @Zucchini) cucumber.glue= # comma separated package names. # example: com.example.glue cucumber.plugin= # comma separated plugin strings. # example: pretty, json:path/to/report.json cucumber.object-factory= # object factory class name. # example: com.example.MyObjectFactory cucumber.snippet-type= # underscore or camelcase. # default: underscore ``` Each property also has an `UPPER_CASE` and `snake_case` variant. For example `cucumber.ansi-colors.disabled` would also be understood as `CUCUMBER_ANSI_COLORS_DISABLED` and `cucumber_ansi_colors_disabled`. TODO: Document --publish and new properties here FAILURE: Build failed with an exception. * Where: Build file 'D:\web-api-commander\build.gradle' line: 141 * What went wrong: Execution failed for task ':testDataDictionary_1_7'. > Process 'command 'C:\Program Files\Java\bin\java.exe'' 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. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 3s 4 actionable tasks: 1 executed, 3 up-to-date
pranedon commented 2 years ago

Sys OS - win 10

OpenJDK version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

darnjo commented 2 years ago

I'll look into this further on my Windows machine and follow up - on Linux and OSX the tags for the resource aren't required so I have a feeling it has something to do with how the args are being parsed in the build.gradle file.

In terms of running it, there's a Windows specific batch file, gradlew.bat that should work. See here for more information. I don't think that's the issue here, but if it helps let me know.

Another thing you might try would be to just leave the quotes empty, i.e. gradlew testDataDictionary_1_7 -DpathToRESOScript=/path/to/dd17.resoscript -DshowResponses=true -Dstrict=true -Dcucumber.filter.tags=""

You might also try running the tests in Docker if that works for you.

darnjo commented 2 years ago

@pranedon this should be taken care of now with #106. Feel free to reopen if not.