1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-24 06:19:57 +01:00

25 Commits

Author SHA1 Message Date
Deltik
f9ba6302c1
Accounted for PHP 7 behavior change in db_verify::getPrevious()
See: https://github.com/e107inc/e107/issues/3768
2019-03-29 18:27:11 -05:00
Deltik
888c559e4c
Merge branch 'ci'
Bringing GitLab CI features to master!
2019-03-29 10:39:35 -05:00
Deltik
eee057c3dd
Initial GitLab CI integration 2019-03-29 10:30:46 -05:00
Deltik
ddb88c726d
Moved off of deprecated Twig classes 2019-03-29 10:14:27 -05:00
Deltik
2a029220a7
cPanelDeployer: Preserve file permissions in ZipArchive
Reference: https://stackoverflow.com/a/53997599/1038828
2019-01-01 11:48:10 -06:00
Deltik
ffd27d2d80
Deactivated "stash" lock in GitPreparer
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.
2018-11-19 15:14:34 -06:00
Nick Liu
1fc01e08f0
Fixed rollback bug in GitPreparer
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 952c6e5890daa36236be675d8c4f21cecabc1fe7.
2018-11-01 09:32:43 -05:00
Nick Liu
952c6e5890
PriorityCallbacks: Execute callbacks before Codeception's
GitPreparer now registers a "priority" register_shutdown_function
callback in order to clean up in case of a fatal error.
2018-11-01 06:57:38 -05: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
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
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
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
Deltik
abc4012a42
cPanelDeployer will no longer delete all databases
Parsing bug deleted all MariaDB users and databases that were not in the
active tests list.  Now, cPanelDeployer will only delete the MariaDB
users and databases that are expired and leave those that are not part
of the testing suite alone.
2018-02-23 16:13:56 -06:00
Deltik
7553ce1857
Fixed regression from 9563f8f
Don't _reconfigure() if no deployer active
2018-02-20 17:31:39 -06:00
Deltik
10019cec74
Better local env config to avoid VCS conflicts
Local environments can now be configured with ./config.yml with a sample
configuration available in ./config.sample.yml
2018-02-16 07:04:03 -06:00
Deltik
34c8bf8afb
Increased compatibility down to PHP 5.6
Removed dependencies installed by Composer
2018-02-12 15:10:27 -06:00
Deltik
b18ef3f830
Ready for testing!
e107 is now ready for fully automated testing on all three test suites:

* Acceptance
* Functional
* Unit

New features:

* cPanelDeployer adds a cPanel Remote MySQL access host
* e107 database dump importer
* Unit tests now load e107

Fixes:

* Test prefixes now only use characters valid for MySQL/MariaDB without
  escaping
* Refactored a bunch of things
* All existing tests pass now

Changes:

* Deployers now provided by \Helper\DeployerFactory
* Added Twig templating for generating e107_config.php for testing
* cPanelDeployer now outputs to codecept_debug()
2018-02-12 13:17:17 -06:00
Deltik
495145df61
Added automatic database support to all suites
Refactored by extracting code common to all suites to \Helper\Base

New \Helper\DelayedDb helper to delay initialization so that a new DSN,
username, and password can be loaded in dynamically for automatic
database provisioning.  Should still be compatible with manual database
information in codeception.yml
2018-02-09 06:45:23 -06:00
Deltik
fabfc67f1b
Refactored cPanel Deployer: Defined components
cPanelDeployer is a bit easier to follow now that there is a concept of
components.
2018-02-08 10:07:03 -06:00
Deltik
a42025c5c6
First working acceptance test
Acceptance test checks the output of e107's /install.php on first load

Also added documentation on acceptance tests to README.md
2018-02-08 05:04:42 -06:00
Deltik
4e779d81de
cPanel Deployer can now bring up and tear down app
Also added more debug messages to cPanel Deployer
2018-02-08 03:56:05 -06:00
Deltik
ba9a27787e
Partial teardown functionality for cPanel deployer
Also renamed class Prepare_cPanel to cPanelDeployer
2018-02-07 05:28:52 -06:00
Deltik
ee84c3de76
Partial support for cPanel acceptance tests
via lib/prepare_cpanel.php
2018-02-07 05:04:28 -06:00
Deltik
da69eb4d8c
Added submodule N1ghteyes/cpanel-UAPI-php-class
For interacting with cPanel for acceptance tests
2018-02-06 04:40:24 -06:00