Codeception won't run any tests. Fails with no errors, quits before running any tests - testing

I go to run an acceptance test, but it only outputs
Codeception PHP Testing Framework v2.0.12
Powered by PHPUnit 4.5.1 by Sebastian Bergmann and contributors.
Then it quits with out any error message. No tests run, no error message.
Browser tests were working fine, and only acceptance tests were broken.
I have all ready solved the problem, but I want to create a record for next time I or any one else runs into this problem.
If you codeception is quitting without any errors or fail messages, it means that there is an error in your code somewhere. I found the error in me Acceptance Helper file, where I had a duplicate of a function. Functions can not have the same name in php, so everything fails. But codeception does not output any error messages.
In order to solve this problem, you need to look through your Helper functions to find a syntax error, or it could be in your actual tests.
The reason it fails is codeception hits an error in the php code, and dies, not throwing any errors. Leaving you confused and frustrated. Now you can find this question and get back to doing what you're doing.
YAY!

There is a syntax error somewhere in your testing code, find it and get rid of it, and it will work. I'd bet the error is in the AcceptanceHelper.php or Browser or what ever suit won't run tests.

If you're seeing this behaviour (codeception quits without any error messages) there is likely a fatal PHP error happening somewhere, but it's not necessarily in your own code or in your codeception generated files.
Depending on your PHP configuration, these errors should show up in an error log, even if they're not output to the console.
For example, if you're using MAMP on Mac, the error log is here by default: /Applications/MAMP/logs/php_error.log
Clear the PHP error log, run your (non-working) test, and check the log again. It should give more insight.
In my case, it was a matter of running codeception 4 on Laravel 5.5, and hence missing classes from the symfony/service-contracts package. Installing this package with composer moved past the "invisible" problem (though I ultimately had to downgrade to composer 3, since there doesn't seem to be a compatible set of symfony/Laravel 5.5/composer 4 packages).

Related

Facing issue while running test cases in xcode10

I am facing xctest encountered error while executing test cases in xcode 10.
The error says
Showing All Messages
xctest (5571) encountered an error (Early unexpected exit, the operation never finished bootstrapping - no restart will be attempted. Underlying error: Test session exited(82) without checking in. The executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch. Retry after a Clean build.)
The same code works fine in Xcode 9.4.1 or below.
Tried all possible solutions over the internet but the issue still exists. The project is in objective C and its a framework project.
Please help me to fix the issue.
Attached the screenshot of the error

UI Tests passing in XCode, Failing in Jenkins

Whenever I run UI Tests locally, they pass, and I can watch the simulator do exactly what it's supposed to.
Then, when the tests run on Jenkins, they fail on the first line.
If it matters, this is the failure:
UI Testing Failure - No matches found for Table
The above error never happens when the tests are running locally.
I appreciate all of the help, and also want to help others with the same issue as much as possible. It's tough, because I can't post code or give too much information, since the code I'm working on is proprietary.
Here was the issue:
I didn't realize that Jenkins just ran the tests on a simulator, on a computer, just like I would do on mine. I had to handle logging into the app in Jenkins' simulator, so that all of the XCUIElements were accessible.
The tests weren't passing the first line, because I wanted to tap a "Settings" button, and a user wasn't even logged in.
Please comment if I can clarify or explain further.

Rubymine / Cucumber: Tests run fine, but are shown as “Failed to start” in Event Log

I have several Cucumber tests that are running fine (I closely watch them), all pass, and everything works good. But Event Log in Rubymine keeps showing all the tests that pass in this way:
Failed to start: 0 passed, 19 not started
Besides, the Run tab (which shows all tests as Passed) also says this after (otherwise successful) run:
Done: Scenarios 0 of 19
Can someone please help me understand why could it happen?
Screenshot:
My setup: Rubymine / Ruby / Selenium / Cucumber.
Ok, apparently it is a bug that exists in the current release build.
I contacted them, and they said it is related to this issue.
They fixed it in EAP build 145.184.8.
I was able to confirm the fix after I installed that build.

django-jenkins ERROR: runTest (django_jenkins.tasks.lettuce_tests.LettuceTestCase)

I've been working with lettuce for interface testing for the last year and lately I've been trying to use it with django-jenkins for continuous integration.
However, I am having problems on executing only the lettuce tests cases I have into the app directory of my Django project.
When I run python manage.py jenkins I get the lettuce tests executed and the lettuce.xml file with the execution details created into the reports folder. Although I am getting two errors I don't know why (see the errors at the end of my post).
I've been trying to google it to see if someone else is having the same problem but I couldn't find anything. If anyone has any idea I will appreciate.
I've been following this tutorial.
You can check the error here
Here you can access my code on github.

Re-running failed and not-run tests in IntelliJ IDEA

Let me describe a simple use-case:
Running all tests in our project may take up to 10 minutes.
Sometimes I see an obvious bug in my code after the first failed test, so I want to stop running all tests, fix the bug and re-run them. Unfortunately, I can either re-run all tests from the beginning, or re-run failed tests only.
Is there a plugin for IDEA which allows me to re-run failed tests AND tests, which weren't yet executed when I pressed "STOP"?
Atlassian has the solution for your problem: Clover. But it is commercial.
This goes against the idea of a test suite. Normally you want to run all your tests specifically so you know you haven't broken anything somewhere unexpected. If you change the code and then run a subset of the tests, the possibility exists that you broke something and one of the skipped tests would have failed. This is a case of not getting your cake and eating it too.
If you find a bug in an early test, by all means stop the suite. Fix the bug but then run the suite from the beginning.