Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Switch to Codeception for testing - #264

Merged
oparoz merged 6 commits into
masterfrom
testing-with-codeception
Aug 16, 2015
Merged

oparoz merged 6 commits into
masterfrom
testing-with-codeception

Conversation

@oparoz

@oparoz oparoz commented Aug 7, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@oparoz
oparoz force-pushed the testing-with-codeception branch 6 times, most recently from 851f19c to fdb5c8e Compare August 7, 2015 17:31
@DeepDiver1975

Copy link
Copy Markdown
Contributor

I honestly question if this is the right way to go.

We dont use codeception anywhere else.
It will be just another entry barrier for new contributors.

Well - lets See where this is leading us ...

@oparoz

oparoz commented Aug 8, 2015

Copy link
Copy Markdown
Contributor Author

We dont use codeception anywhere else.

That's correct and it has not been missed so far, because for unit and basic integration tests, PHPUnit is enough. ownCloud has a few acceptance tests in various folders, but they require different environments, depending on who has written them.

It will be just another entry barrier for new contributors.

I don't think it will, since Codeception understands standard PHPUnit tests and syntax.
I didn't have to modify a single test and still got my coverage report in Scrutinizer. The only thing I've changed is make Travis run codecept instead of phpunit.
For devs testing locally, it's a matter of running codecept run unit instead of phpunit -c phpunit.xml

There is a barrier of entry for people who want to contribute to the bootstrapping code for the acceptance tests, but I don't think that will be done by new contributors. They will focus on writing the test themselves.

The main advantages:

  • Easy to set up. As a contributor it's as easy as just downloading the phar file
  • One command to run all tests
  • Easy to understand structure in tests folder
  • Easy to test API/ajax endpoints. Requires 15 minutes to read about the syntax to use
  • Easy to write acceptance tests, which come with screenshots. Same syntax as above, but with some new keywords
  • Offers a choice between standard PHPUnit test and Codeception Cest for unit testing. That could be a problem for newcomers if most test are Cest classes, but they are easy to read and contributors can still use PHPUnit if that's easier for them.

The main problems:

  • It doesn't understand Gherkin scenarios. That could be a problem for core if you have your BAs collecting requirements in that format. Regarding this project, I don't think many people will approach the maintainers with such scenarios, expecting them to implemented a feature and even if they did, it's relatively easy to translate them to tests. Also, Codeception can generate scenarios from the tests themselves, so you can still compare both the original specs and Codeception's text output to make sure they match

Let me know if you have specific concerns I may have overlooked :)

@oparoz
oparoz force-pushed the testing-with-codeception branch 8 times, most recently from 43b5702 to bcc04fa Compare August 9, 2015 21:37
@oparoz
oparoz force-pushed the testing-with-codeception branch 12 times, most recently from e46337a to d41fade Compare August 10, 2015 12:26
@oparoz
oparoz force-pushed the testing-with-codeception branch 12 times, most recently from f07fa75 to d7c1c2f Compare August 10, 2015 23:35
@oparoz
oparoz force-pushed the testing-with-codeception branch 4 times, most recently from 97ca579 to 5907d31 Compare August 15, 2015 02:57
@oparoz
oparoz force-pushed the testing-with-codeception branch from 5907d31 to 6b8a2bf Compare August 15, 2015 19:27
@oparoz
oparoz force-pushed the testing-with-codeception branch from 2d32d45 to 7d1948d Compare August 16, 2015 00:04
oparoz added a commit that referenced this pull request Aug 16, 2015
@oparoz
oparoz merged commit 6713ae3 into master Aug 16, 2015
@oparoz
oparoz deleted the testing-with-codeception branch August 16, 2015 00:25
@oparoz oparoz self-assigned this Aug 17, 2015
@oparoz oparoz added this to the 8.2-current milestone Aug 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants