When I run all my cucumber features my system hangs, there seems to be a memory leak. I would like to find out which features create this problem. There are lot of feature files so I cannot run them individually
Using the pretty formatter will print the feature and scenario names as the tests run
cucumber --format pretty
You can also add this to the cucumber.yml config file if you are using rake to run the cukes.
Related
When using vagrant machines with test-kitchen the pre_create_command allows you to specify a command which is run locally before the vagrant machine is being created. With kitchen-docker no such configuration option seems to exist, and bending chef_omnibus_url as suggested here isn't an option.
The script specified as pre_create_command for the testing vagrants generates a local chef data bag.
Is there a solution around which I've overlooked?
Best practices include Rakefile and Thor.
In essence you control your tests from a Rakefile. For example:
rake style
This will run all commands under your style task (maybe lint/syntax/unit and kitchen tests). Of course you can modify your tasks to perform whatever you like. Here are some good resources:
https://blog.chef.io/2015/04/21/overview-of-test-driven-infrastructure-with-chef/
See the Supporting Tools and Dependencies section.
Here is an example Rakefile:
https://github.com/chef-cookbooks/chef-server/blob/master/Rakefile
I sketched a patch for kitchen-docker here. However, as the discussion on this pull request shows, there are arguments against an appropriate functionality in kitchen-docker, namely the one that such functionality (if ever) should go in the kitchen core.
So for the time being we have to live with this inconsistency between docker and vagrant, and this is where thun's answer comes into play.
This can be done using
driver_config:
provision_command: <command>
in kitchen.yml
Check more here
Kr,
Rshad
This one is quite strange.
I am running a very typical Docker container that holds a Rails API. Inside this API, I have an endpoint which takes an upload of a CSV and does some things and stuff.
Here is the exact flow:
vim spec/fixtuers/bid_update.csv
# fill it with some data
# now we call the spec that uses this fixture
docker-compose run --rm web bundle exec rspec spec/requests/bids_spec.rb
# and now the csv is loaded and I can see it as plaintext
However, after creating this, I decided to change the content of the CSV. So I do this, adding a column and respective value to it for each piece.
Now, however, when we run our spec again after saving this it has the old version of the CSV. The one originally used at the breakpoint in the spec.
cat'ing out the CSV shows it clearly should have the new content.
Restarting the VM does nothing. The only solution I've found is to docker-machine rm dev and build a new machine (my main one for this is called dev).
I am entirely perplexed as to what could cause this or a simple means to fix it (building with all those images takes a while).
Ideas? Inform me I'm an idiot and I just had to press 0 for an operator and they would have fixed it?
Any help appreciated :)
I think it could be an issue with how virtualbox shares folders with your environment. More information here https://github.com/mitchellh/vagrant/issues/351#issuecomment-1339640
I have recently started using ruby to write tests for selenium but I would like a way for the tests to be exported into a results file.
For an example of what i mean. I was exporting the tests from the IDE to html and then running them using
java -jar selenium-server-standalone-2.39.0.jar -htmlSuite *firefox http://google.com /path/to/suite.html /path/to/results.html
in the command line and it would run the suite.html and then post the results in results.html
Is this possible in Ruby?
Looks like someone has already taken on the same challenge before. See this article how to export results when running selenium ruby webdriver scripts to output files from command prompt ruby window.
You may have to write up a rake file, but I believe it will be a good experience that will make you better acquainted with ruby and how to go about selenium testing with it.
When I rake my db in emacs, it fails– although it works fine in terminal. The error is related specifically to an environment variable that emacs doesn't seem to be picking up on. What is the best way to resolve this in .emacs? Do I need to source my profile every time I start emacs?
Which emacs shell are you using? There are a few different types which are good for different cases. I recently read this article which you may find informative: http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/
I suggest trying simply M-x shell which will simply run your default shell in emacs (usually bash).
I'm using a public Windows computer where the command line has been disabled. By using Instant Rails I'm able to create customize and test rails apps to some degree but can't use the Rails commands.
Question:
How do I use these commands with a disabled command line?
I've tried using SciTe, Notepad++ but all these just access the same disabled cmd so those won't work.
Some editors that deal with Rails specifically can do this. Netbeans, RadRails and RubyMine come to mind.
However, if your command line is disabled, you're probably not going to be able to `install them either.
As EmFi said, NetBeans has both a built-in Rails console and the ability to run migrations and Rake tasks from a menu. So with NetBeans, you'd be able to run migration and Rake tasks without needing a command line at all.
Here's another option...
If you're able to install software on the machine, maybe you could install something like Cygwin or MinGW. They provide a command prompt with a Unix-like environment. I've used both. Personally, I think MinGW would give you a smoother, simpler experience with fewer gotchas, but Cygwin is very popular.