1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-25 23:02:34 +01:00

337 Commits

Author SHA1 Message Date
Cameron
9209f912fa db-verify compare 2018-09-16 16:31:32 -07:00
Cameron
7bbf3164c7 Test for [img] bbcode in toHTML() 2018-09-12 13:21:19 -07:00
Nick Liu
c72b08616b
Refactored E107Base suite cleanup into "Preparer" classes
Now works with the best of both worlds:

* Barebones cleanup in slow Windows environments
* Git snapshots in other Git environments
2018-09-12 12:54:15 -05:00
Cameron
124381f5e7 Merge branch 'master' of https://github.com/e107inc/e107-test 2018-09-11 14:16:29 -07:00
Cameron
4245ff138d Work in Progress. 2018-09-11 14:16:10 -07:00
Nick Liu
11448a4a9f
Fixed possible fatal error in e107Test 2018-09-11 16:14:01 -05:00
Cameron
0fca5840f2 Disabled VCS modification. Added fixed hash folder name and cleanup before/after tests. 2018-09-09 18:20:20 -07:00
Cameron
5b9e2572a4 Test fixes. 2018-09-09 10:18:19 -07:00
Nick Liu
8f38794e14
Merge branch 'master' of github.com:e107inc/e107-test 2018-09-09 01:18:48 -05:00
Nick Liu
3af03f1f5e
Greatly improved robustness of E107Base
Fixed irreversible data loss bug when preparing the app path repo
for tests

OLD BEHAVIOR
Remove untracked files from the working tree before and after
every test suite. The intention was to remove files that could
have been created by the tests, but this also removes all other
untracked files, including third-party plugins and themes.

NEW BEHAVIOR
There is now a triple locking mechanism protecting the state of
the app repository before tests are run so that after tests have
run, all file contents are restored to how they were before the
tests have run.

There are three locks, each guarding a different part of the
original repo:

* file
* commit
* stash

When the file lock is present, E107Base knows that any other file,
tracked, untracked, or ignored, was created by the tested code.

The file lock is checked into the commit lock, which saves all
tracked and untracked files in the form of a commit. This way,
uncommitted code can be tested without manually making a commit that
includes the untracked files.

The stash lock saves all ignored files in a Git stash. Ignored files
go in a stash instead of in the commit lock because they can be a
confounding variable affecting the outcome of tests. They are usually
user-configurable only and may not represent tested states.

When the saving is complete, E107Base will have access to tracked and
untracked files but not ignored files. The tests are run in this
configuration.

After each test suite runs, the repo is reset and cleaned to return
the files to the same state they were in before the test suite began.

Then, the locks are undone first by rolling back the commit lock,
which restores the originally uncommitted tracked and untracked
files. Next, the stash lock is popped, restoring the originally
ignored files. Finally, the file lock is removed, signifying that the
repo is back to its original data before the test suite was run.

In case of an ungraceful exit, at least one of the locks would be
left in the repo. The next time E107Base runs, locks are checked, and
if one or more are present, the repo is restored before the locks are
reestablished.

If the `git` command is inoperative, only the file lock is operative
and does nothing more than signify a test that is in progress or has
exited unexpectedly. Data protection is silently unenforced. This can
lead to unexpected tracked, untracked, and ignored file modifications
that will not be rolled back after a test suite has run.
2018-09-09 01:18:09 -05:00
Cameron
bc29ef1efe Removed buggy value unserialize test. 2018-09-08 13:44:07 -07:00
Cameron
aef5a04e00 More admin-ui tests and separate inline checks. (very basic right now) 2018-09-04 15:26:29 -07:00
Nick Liu
5a8e4e166f
Initial integration with GitLab CI 2018-08-29 15:58:17 -05:00
Nick L
fc96dd5281
Merge pull request #12 from SimSync/fix_11
fixes #11 Typo in assertEquals
2018-08-27 09:58:28 -05:00
Achim Ennenbach
4fca8150d0 fixes #11 Typo in assertEquals 2018-08-27 15:39:59 +02:00
Cameron
7c7f636f3c Check TinyMce is installed after installations. 2018-08-25 15:32:11 -07:00
Cameron
71cca7bc86 Merge branch 'master' of https://github.com/e107inc/e107-test 2018-08-24 13:01:27 -07:00
Cameron
8d56b1ef2f Added tests for admin URL content. (to be completed) 2018-08-24 12:52:57 -07:00
Nick Liu
c94bbd8e14
More detailed assertion fail message in e_fileTest 2018-08-24 12:58:19 -05:00
Cameron
6914d035fb Fixed file_size_decode test. Added simple TinyMce parser test. 2018-08-22 09:48:47 -07:00
Cameron
ceab083b5e file_size_decode() test added. 2018-08-20 13:48:29 -07:00
Cameron
ccd877d09d Search test class placeholder added. Simple table parsing test added to db_verify test. 2018-08-17 13:56:35 -07:00
Nick Liu
6de885cd79
Updated documentation and renamed "cpanel" section to "hosting" 2018-08-16 09:15:47 -05:00
Nick Liu
ee7808b7bf
Major improvements to Deployer system (backwards-incompatible)
Deployers, a concept unique to this repository, are now more separated
from Codeception modules.

This commit adds NoopDeployer, LocalDeployer, and SFTPDeployer to
address the three deployment target types in use by testers today.

The changes are backwards-incompatible because the structure of
config.sample.yml has changed, and all testers need to change their
config.yml or config.local.yml to continue testing. The reason for this
change is that the section "manual" no longer makes sense now that
Deployers are on a spectrum of automation levels.

The subsections under "manual" have been broken out into the root level.

The "db_dump" section has been merged into the new "db" root section.

There is a new "fs" root section used by the SFTP Deployer.

Other changes, enhancements, and bugfixes:

* cPanelDeployer no longer downgrades to "manual" mode when credentials
  are missing or an unsupported component is requested. It now throws an
  exception.
* Deployer::unlinkAppFile() was implemented for acceptance tests out of
  necessity because the app requires a configuration file to be deleted
  before re-running the app's installer.
* If a Deployer subclass does not implement the unlinkAppFile() method,
  tests that depend on the method will be skipped gracefully.
* DeployerFactory now has a better autoload mechanism.
* A logical error in lib/config.php prevented missing nested array items
  from using their default values.
* The Base Helper no longer pointlessly caches the DelayedDb module
* _bootstrap.php serializes the config.yml params into a global constant
  so that the DeployerFactory can freely access the information.
2018-08-15 23:04:59 -05:00
Nick Liu
b440ab7274
Merge branch 'master' of github.com:e107inc/e107-test 2018-08-15 17:09:46 -05:00
Cameron
5e5a13cc62 Added check for Custom-fields 'boostrap3' install.xml data. 2018-08-14 17:07:56 -07:00
Nick Liu
b5b59392eb
Started a basic interface to manipulate files in acceptance tests
- MOD: Renamed lib/deployers/cpanel_deployer.php to
       lib/deployers/cPanelDeployer.php
- MOD: Moved responsibility of reconfiguring Codeception modules to the
       deployers.
- NEW: Abstract class Deployer to standardize the interface to Deployers
- NEW: Acceptance tests now support unlinkE107ConfigFromTestEnvironment
- MOD: Removed null checks for the Deployer in the Base Module
- MOD: Improved public method naming in the Base Module
- MOD: DeployerFactory always returns a Deployer implementation now.
- MOD: InstallCest always clears out the e107_config.php file before
       each test.
2018-08-14 16:03:30 -05:00
Cameron
58cd6f1c05 basic custom-fields test added. 2018-08-13 15:03:56 -07:00
Cameron
c0b24d71a5 Added simple Captcha rendering test. 2018-08-12 10:20:33 -07:00
Nick L
f3acf43dd6
Merge pull request #10 from SimSync/test_title2sef
added tests for `eHelper::title2sef()`
2018-08-11 14:50:56 -05:00
Achim Ennenbach
7c37b4ba6f added tests for eHelper::title2sef()
The tests are based on my PR e107inc/e107#3370
2018-08-10 21:39:38 +02:00
Cameron
d73bcacaaa New tests for file_class and eHelper placeholder test class added 2018-08-10 11:10:59 -07:00
Cameron
bee5c325d6 Added test for admin-ui Image in form test. (including legacy image path) 2018-08-06 13:08:02 -07:00
Nick Liu
3a0dd50e7c
Improved flexibility of codeception.yml
- MOD: Reduced code duplication in ./lib/config.php
- MOD: Replaced PHP 7.1 samples with PHP 7.2 samples in README.md
- NEW: ./config.sample.yml now supports customized database dumps, which
       affects the Codeception database populator
- NEW: Code coverage reports now take into account the configured
       `app_path`, which obviates a separate codeception.sample.yml file
       and reduces the complexity in setting up this test harness

@CaMer0n and @SimSync: I'm aware that you previously needed a separate
codeception.yml file because the coverage reports didn't use the
`app_path` from `config.yml`. This has been fixed. I'd like to keep just
one place for custom configurations (config.yml) so that we can keep
tests reproducible and avoid inconsistencies if/when codeception.yml
gets updated in the future.
2018-08-06 07:25:05 -05:00
Cameron
4edf051945 plugin class tests. 2018-08-05 15:09:33 -07:00
Cameron
d8cfcb0812 plugin tests. Currently failing on remotePluginTest. (reason unknown) 2018-08-03 16:14:33 -07:00
Cameron
c62674c4a5 added simple remote plugin download test. 2018-08-03 13:13:25 -07:00
Cameron
08852f1d61 basic thumbUrl test. 2018-07-28 09:30:37 -07:00
Cameron
7f18e9ddb3 media and file class tests added. 2018-07-27 12:08:28 -07:00
Cameron
8200c7dd00 Simple e_parse toForm test added. 2018-07-24 15:53:34 -07:00
Cameron
76d491c0b9 Simple toHTML() test added. e_parser methods moved into e_parseTest 2018-07-24 13:01:29 -07:00
Cameron
794725b9f5 Added tests for multiple installation scenarios. (Currently different themes) 2018-07-24 12:06:24 -07:00
Cameron
0a1d768840 Made it easier to debug a single plugin. Added extra checks in the linksword plugin test. Disabled empty db_verify tests. 2018-07-23 14:02:30 -07:00
Nick Liu
3c8e52af93
Fixed regressions in unit e_formTest.php
Fixes: #8
2018-07-23 07:17:06 -05:00
Cameron
4320399ea7 Fixed a typo 2018-07-22 11:05:38 -07:00
Cameron
ab35c8a1df Improved code completion in PHPStorm 2018-07-22 11:01:21 -07:00
Cameron
ad9935b666 Code cleanup 2018-07-22 10:52:06 -07:00
Cameron
1c473c96b9 Test added for e_array and placeholder file for core_functions. 2018-07-22 10:41:16 -07:00
Nick L
0fcbba8f67
Merge pull request #7 from SimSync/test_uc_select
added tests for uc_select
2018-07-22 10:09:35 -05:00
Achim Ennenbach
deb544f2cf added tests for uc_select 2018-07-21 22:09:35 +02:00