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
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.
we've just started to move a spring boot project to a new build system. Previously everything ran with gitlab docker runners and should now work with a kubernetes runner.
When I run the exact same build pipeline with the same docker image on k8s instead with the old runner the tests will run infinite until they reach gitlabs pipeline timeout.
This is always the last line in the log after which spring just seems to just hang:
2021-01-14 09:30:18.126 DEBUG 536 --- [ Test worker] .c.JpaMetamodelMappingContextFactoryBean : Initializing JpaMetamodelMappingContext…
If I connect into the pod an run the ./gradlew test --debug command by hand it will also hang most of the times and sometimes miraculously finish.
I'm very much out of ideas right now why spring would suddenly hang at/after that specific point in the code. I've searched a little bit through the org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean.createInstance() code to maybe get a clue why this is happening, but no luck so far.
I mean based on the fact that it works in every other environment we have it, the problem should be related to the kubernetes env but I'm not sure how this would make spring hang at the code mentioned above. Maybe some kind of race condition since it sometimes does work, when run by hand?
The gitlab ci stage right now looks like this
test:all:
image: openjdk:11
stage: test
tags:
- kubernetes
script:
- ./gradlew assemble --build-cache
- ./gradlew test
Turns out upgrading Spring Boot 2.3.4-RELEASE to 2.4.1 fixes the problem.
I am currently running cypress tests using:
await cypress.run({config inserted here})
Wondering if there is a way to spin up one of cypress's docker containers and then point the cypress tests there using the statement above. The suggestions online are to run the tests using command line, but I'm hoping to still be able to use cypress.run() and perhaps pass in an option that tells cypress to point the tests to a container?
Cypress docker containers will invoke cypress run by default. To change that, you'll need to override the container entrypoint to invoke node instead of cypress, and then pass your script file that's invoking cypress via the module api (cypress.run()) as the container command. You could do this via the command line, but it's a bit long because of all the options you'll need to pass:
# Assumes you're running this from the Cypress project directory on the host machine
$ docker run -it --rm -v $PWD:/tests -w /tests --entrypoint "/usr/local/bin/node" cypress/included:3.2.0 "myScript.js"
Warning: you're mounting in your npm dependencies with this method, which might cause problems if any of them were compiled on a different os like Windows.
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
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!