-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated Testing for e107 #4038
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now works with the best of both worlds: * Barebones cleanup in slow Windows environments * Git snapshots in other Git environments
InstallCest now drops all tables from the test database before running each test. Fixes: #13
GitPreparer now registers a "priority" register_shutdown_function callback in order to clean up in case of a fatal error.
Removed unused includes/bootstrap.php Made a new e107 sample database dump
Added a guard to GitPreparer::unsetVcsInProgress() to prevent doing a `git reset` when there are no test locks present. Otherwise, the uncommitted changes in the app will be removed by the shutdown feature introduced in 952c6e5.
e107pluginTest::testXmlSiteLinks() ignores the primary key and model order because another test could have inserted records before this test.
Other tests have been meddling with the e107::wysiwyg() global state e_parseTest::testToForm() now considers two outcomes of the e107::wysiwyg() state.
e_shortcode_parser normally doesn't need reloading in an e107 installation because installing the "banner" plugin and parsing shortcodes have always been two separate script calls (page loads). It would slow down the e107 core to add an e_shortcode_parser reloader after installing a plugin when the page would later exit without parsing any shortcodes.
New test forces a failover of the `readfile()` internal function to test the failover functionality of \e107\Shims\Internal::readfile()
See #3547 for details.
New tests cover the behavior described in #3547
The "stash" lock was used to shove .gitignore'd files under the rug so that they would not interfere with a pure copy of the app. Vendor files may be ignored in the app, so for performance, the "stash" lock has been deactivated. Vendor files no longer need to be downloaded each time the test runs. The "commit" lock now includes all ignored files so that tests are run with the files as they are.
- MOD: PHPDoc for e_file::unzipGithubArchive() - NEW: e_file::unzipGithubArchive(): Added exclusions for files that don't exist in production - NEW: e_file::unzipGithubArchive(): Accept a destination path argument for a custom extraction location - NEW: Restored unimplemented skipped list in e_file::unzipGithubArchive() - FIX: e_file::unzipGithubArchive(): Extraction fails if parent directory of file doesn't exist - MOD: Type hint for Base::$deployer - NEW: Basic test for e_file::unzipGithubArchive()
Deltik
added
core: testing framework
type: enhancement
An improvement or new feature request
labels
Dec 27, 2019
Error message from Code Climate: > Exception: The given file "/code/e107_tests/lib/ci/salt/pillars/config-local.sls" does not exist. in /usr/src/app/vendor/pdepend/pdepend/src/main/php/PDepend/Engine.php > #0 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(129): PDepend\Engine->addFile('/code/e107_test...') > #1 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(109): PHPMD\ParserFactory->initInput(Object(PDepend\Engine), Object(PHPMD\PHPMD)) > #2 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(76): PHPMD\ParserFactory->init(Object(PDepend\Engine), Object(PHPMD\PHPMD)) > #3 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php(215): PHPMD\ParserFactory->create(Object(PHPMD\PHPMD)) > #4 /usr/src/app/Runner.php(116): PHPMD\PHPMD->processFiles('/code/e107_test...', 'cleancode,unuse...', Array, Object(PHPMD\RuleSetFactory)) > #5 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1852): CodeClimate\PHPMD\Runner->run(Array) > #6 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1772): fork_daemon->invoke_callback(Array, Array, false) > #7 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1673): fork_daemon->fork_work_unit(Array, '', -1) > #8 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1445): fork_daemon->process_work_unit(-1) > #9 /usr/src/app/Runner.php(31): fork_daemon->process_work(false) > #10 /usr/src/app/engine.php(35): CodeClimate\PHPMD\Runner->queueDirectory('/code') > #11 {main}
Increased possible random strings for unique fields in e_db_pdo::copyRow() from 1000 to 59^11 (UserHandler::generateRandomString() "alphanumeric" should have 59 characters to choose from) If a collision still happens, e_db_pdo::copyRow() retries up to 3 times for a successful copy. Fixes: #3678
Broken due to Codeception moving modules out of codeception/codeception
Fixes: "The method copyRow() has an NPath complexity of 252. The configured NPath complexity threshold is 200."
Deltik
force-pushed
the
test-harness
branch
2 times, most recently
from
December 28, 2019 15:33
578ef7e
to
1aff15d
Compare
Deltik
force-pushed
the
test-harness
branch
3 times, most recently
from
December 28, 2019 17:22
1971afd
to
450837f
Compare
- NEW: Logo at the top - MOD: Moved Gitter badge to the end - MOD: Added e107 logo to GitHub release badge - MOD: Replaced GitHub Workflow badge with Shields.io equivalent for consistency - MOD: Replaced Codecov code coverage badge with Code Climate equivalent - MOD: Added Gitter logo and styling to Gitter badge
Code Climate has analyzed commit 8d5d184 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 47.5% (80% is the threshold). This pull request will bring the total coverage in the repository to 5.4%. View more on Code Climate. |
CaMer0n
approved these changes
Dec 28, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!! :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Automated testing makes it possible to write code and verify the code's behavior without needing to check the output via a web browser. It also catches regressions in case a change to existing code causes tests to fail.
e107 had automated tests since 12 February 2018, but the tests were in a separate repository that loaded e107's source code from a Git submodule. This had various drawbacks:
This pull request brings in the entirety of the e107-test repository into the main e107 repository under the folder
e107_tests
, in accordance with the long-established e107 folder structure.Continuous integration with GitHub Actions is also implemented, and code coverage reports are uploaded to Code Climate.
Description
e107_tests
in the main repositorye107_tests
folder for those updating e107 to the latest master commit via the web admin interfaceHow Has This Been Tested?
Through the tests in the
e107_tests
folder!Types of Changes
Checklist