#CucumberOptions(features = {"src/test/resources/features/module*.feature"},
tags = "#E2e",)
mvn clean verify -Dcucumber.features=”module*.feature” -Dcucumber.filter.tags="#E2E"
Is there any way to use regex to identify feature files? It takes it up as file name.
I want moduleone,moduletwo,modulethree to get executed.
PS: I am aware about tags but my logic is in such a way that using feature regex will help me.
The short answer is no. You can not. You can only reference files or directories. Patterns are not supported.
Related
I need to read from a JSON configuration file in Azure Function. Is there a way to refer to the file without hard-coding any paths(assuming it's in same directory as the code).
The solution in another answer was something like:
string configuration = string.IsNullOrEmpty(configurationFile) ? "" : File.ReadAllText(Environment.GetEnvironmentVariable("HOME") + #"\site\wwwroot\functionname\filename);
Is there a better way to get this path, or read JSON configuration in general for Azure Function?
Currently, the solution you found is the recommended approach, but with the next release, which is starting to roll out today (5/30/2017), we've introduced a feature to enhance this.
You can learn more about it here:
https://github.com/Azure/azure-webjobs-sdk-script/wiki/Retrieving-information-about-the-currently-running-function
you're able to find out some explanations about this same topic on this another thread, here.
I hope that this information help you.
Is it possible to parameterise a feature file in the same way it is a scenario? So each scenario in the feature could refer to some variables which are later defined by a single table for the entire feature file?
All of the answers I've found so far (Feature and scenario outline name in cucumber before hook for example) use Ruby meta-programming, which doesn't inspire much hope for the jvm setup I'm using.
No its not, and for good reason. Feature files are meant to be simple and readable, they are not for programming. Even using scenario outlines and tables is generally not a good thing, so taking this further and having a feature that cannot be understood without reading some other thing that defines variables is counter productive.
You can however put all your variables and stuff in step definitions and write your feature at a higher level of abstraction. You'll find implementing this much easier, as you can use a programming language (which is good at this stuff).
One way of parameterising a feature file is to generate it from a template at compile-time. Then at runtime your cucumber runner executes the generated feature file.
This is fairly easy to do if you are using gradle. Here is an example:
In build.gradle, add groovy code like this:
import groovy.text.GStringTemplateEngine
task generateFeatureFiles {
doFirst {
File featuresDir = new File(sourceSets.main.output.resourcesDir, "features")
File templateFile = new File(featuresDir, "myFeature.template")
def(String bestDay, String currentDay) = ["Friday", "Sunday"]
File featureFile = new File(featuresDir, "${bestDay}-${currentDay}.feature")
Map bindings = [bestDay: bestDay, currentDay: currentDay]
String featureText = new GStringTemplateEngine().createTemplate(templateFile).make(bindings)
featureFile.text = featureText
}
}
processResources.finalizedBy(generateFeatureFiles)
myFeature.template is in the src/main/resources/features directory and might look like this:
Feature: Is it $bestDay yet?
Everybody wants to know when it's $bestDay
Scenario: $currentDay isn't $bestDay
Given today is $currentDay
When I ask whether it's $bestDay yet
Then I should be told "Nope"
Running the build task will create a Friday-Sunday.feature file in build/src/main/resources with the bestDay and currentDay parameters filled in.
The generateFeatureFiles custom task runs immediately after the processResources task. The generated feature file can then be executed by the cucumber runner.
You could generate any number of feature files from the feature template file. The code could read in parameters from a config file in your resources directory for example.
I'm kinda new to linux so you'll have to pardon my question if it's really basic. I have a code snippet that includes the following line:
require("axf.sf")
I am trying to find the file that contains this code.
I've tried the following commands on my server:
find / -name axf.sf
find / -name axf.sf*
But I can't locate it. I know the code exists because the program works.
any suggestions would be appreciated.
Lua, like many languages, has the concept of a "path" to search for required modules.
It can be configured by several means, but it's usually something like
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua
(you can verify if your's is different by checking typing =package.path at a Lua prompt)
The default package searcher first takes the package name ("axf.sf" in your example) and replaces each dot with the OS's directory separator. ("axf/sf" in your example, since you're on Linux). Then it replaces the ? on each pattern with the transformed package name, and uses the first one that exists on your system.
so, it would search for
./axf/sf.lua
/usr/local/share/lua/5.1/axf/sf.lua
/usr/local/share/lua/5.1/axf/sf/init.lua
/usr/local/lib/lua/5.1/axf/sf.lua
/usr/local/lib/lua/5.1/axf/sf/init.lua
/usr/share/lua/5.1/axf/sf.lua
/usr/share/lua/5.1/axf/sf/init.lua
Does anyone have any example of how to use modification reader task?
Ok, I use this over XML:
<modificationReader>
<filename>mods.xml</filename>
<path>path/to/my/file/</path>
</modificationReader>
then, what? How do I get the information in "mods.xml" and use it?
Thanks
This appears to be used with the modificationWriter task which writes the modifications to a file (in the artifact directory by default).
http://build.sharpdevelop.net/ccnet/doc/CCNET/Modification%20Writer%20Task.html
If you're just trying to read in the modifications in to a different projects' buildLog, the above - with a path to the first project - should be sufficient.
Are you trying to do something different?
CruiseControl.NET: Build subproject obtained by SVN
I came across echofunc.vim today (from a link in SO). Since I'm rubbish at remembering the order of function parameters, it looked like a very useful tool for me.
But the documentation is a bit lean on installation! And I've not been able to find any supplementary resources on the internet.
I'm trying to get it running on a RHEL box. I've copied the script into ~/.vim/plugin/echofunc.vim however no prompt when I type in a function name followed by '('. I've tried adding
let g:EchoFuncLangsUsed = ["php","java","cpp"]
to my .vimrc - still no prompting.
I'm guessing it needs to read from a dictionary somewhere - although there is a file in /usr/share/vim/vim70/ftplugin/php.vim, this is the RH default and does not include an explicit function list.
I'm not too bothered about getting hints on the functions/methods I've defined - just trying to get hints for the built-in functions. I can see there is a dictionary file available here which appears to provide the resources required for echofunc.vim, I can't see how I set this up.
TIA,
It expects a tags file, the last line of the description describes exactly how to generate it:
ctags -R --fields=+lS .
It works here with PHP but not with JS. Your mileage may vary.
I didn't know about this plugin, thanks for the info.
You should try phpcomplete.vim, it shows a prototype of the current function in a scratchpad. It is PHP only, though.