Kicking off some much overdue TDD with Serverless.
I've installed serverless-mocha-plugin as per https://serverless.com/blog/tdd-serverless/
When I try to sls create test -f I dont get any output
I have tried a few different params to but no results. No test is created. I've tried SLS_DEBUG=true and nothing of interest is shown there either
The output of sls command shows the invoke test and create test functionality is available.
Anyone got any ideas on where start debugging this?
your serveless might be outdated; update it via npm install serverless -g
and your plugin is outdated as well, try installing and adding in your serverless.yml file; jest is from mocha and they're test functionality are the same
plugins:
- serverless-jest-plugin
then install via
sls plugin install --name serverless-jest-plugin
then try the create test again
Related
I have done lot of research of running some tests in parallel and some in series. Still, not have any great options for doing that. We'll have 4 virtual machines to done this. All tose vm's has own docker for application with own database as well. I have few tests which need to be run at the same machine.
I'll thinking can there be given some tags or something which can be configured so that spesified tags will run on VM 1 example?
Found solution by plugin named Cypress grep, link is below. With it you can write tags to tests like this:
it('works', { tags: '#smoke' }, () => ...)
run all tests tagged #smoke
$ npx cypress run --env grepTags=#smoke
run all tests except tagged #smoke
$ npx cypress run --env grepTags=-#smoke
Install instructions and usage: https://www.npmjs.com/package/#cypress/grep
Work the way as the Robot Framework tags.
I'm working with the Cypress test suite and am rolling it out across our development team. We all run on virtual machines that are, in principle, identical; in practice the machines are re-built once a month so in the meantime developers are free to download and install anything they require so the machines can get messy.
I have a git repository with the cypress code. The primary development environment is dotnet, so the cypress tests are the only node.js code being worked on. I have had a number of developers able to set up the cypress tests on their vms by following the steps of
install latest node.js (16.17.1)
clone from git
run 'npm install' to get the relevant libraries. package.json refers to Cypress 10.10.0
All works fine and they can run the cypress desktop tool and run tests okay. However, I have one developer whose machine is not playing ball. After running the above, when attempting to run cypress the tool displays the not-very-useful error of 'Warning:Unexpected Internal Error. We encountered an unexpected internal error. Please check GitHub or open a new issue if you don't see one already with the details below:'
There are, unfortunately, no details below.
I have been able to run the cypress desktop tool from cmd.exe with DEBUG=cypress:* set on and got a decent amount of debug output. Comparing a working machine to the non-working machine I can see the difference in the output starts at an error message as follows
2022-10-17T00:12:58.883Z cypress:lifecycle:ProjectConfigManager error watching config files Error: UNKNOWN: unknown error, watch
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
{
errno: -4094,
syscall: 'watch',
code: 'UNKNOWN',
filename: null
}
I've hit the googles but not got much information on what this is referring to - I assume there's some configuration file that's not set up on this specific developer's machine.
Has anyone else come across this error before, and if so have you any suggestions where I can look to hunt down the issue?
I run my tests in the docker container and I would not want to see the logs about the results of the tests (since I run several instances of cypress and logs are mixed). Is there any way to turn off logging?
I have read documentation but i haven't found anything.
As per this github issue: https://github.com/cypress-io/cypress/issues/2071.
That issue was resolved at the 4.9.0 release of Cypress.
You can now run your Cypress tests with the --quiet flag. e g.:
cypress run --quiet
I'm trying run some specific scenarios using tags but I'm unable to finsh some documentation regarding that. What I want to do is run all scenarios that are marked with a specific tag. Look at the example provided on the github but it doesn't say much. What I want to do is:
#onlyone
Scenario: a random feature
Given: something
When: I do something
Then only this test should be ran
So what I want to do is run the following command nightwatch --tag #onlyone only the scenarios with that tag should be ran.
Found the appropiate documentation, Nightwatch Documentation it was an error on my part.
For me, it has been enough to run it from the command line without previous configuration.
Try this:
npm run test -- --tags #my-tag
or
npm run test:run -- --tags #my-tag
Hope this will work for you!
So kind of a noob here but I can't seem to find any examples or help anywhere. I have a working instance of NSQ, can register tasks, consumers, etc. Unfortunately I did not originally set the system up. What I am trying to do is figure out how to activate some of the built in command line tools that NSQ offers ( nsq_to_file, nsq_tail, etc. ). I found documentation on how to fire them but have no idea where to fire them from.
When I try nsq_tail --channel=MyTestChannel --topic=test --lookupd-http-address=127.0.0.1:4161 i get nsq_tail command not found. The only other thing I know is that NSQ is managed by docker in our circumstance. Any help / a shove in the right direction would be awesome. Thanks!
Did some digging and answered my own question. Hopefully this helps someone since the docs dont really exist:
Make sure NSQ is running by checking out the dashboard: localhost:4171
Install the NSQ library (different than nsq-go) go get github.com/bitly/nsq
Install godep, how bitly manages dependencies go get github.com/tools/godep
Go to bitly src directory cd $GOPATH/src/github.com/bitly
Use docker to compile and test the nsq command line tools sudo docker build nsq
You should see about 5 or 6 steps run followed by a schlew of tests and a success message.
Run nsq_tail you should see something along the lines of --topic is required
Clap your hands, you just installed the command line tools for NSQ.
Might also need to install docker if you don't have it, not referenced above but FYI.