Skip to content

Commit

Permalink
Fix file permissions and move composer vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Aug 10, 2022
1 parent 7f14fef commit e3ab1fc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 30 deletions.
16 changes: 4 additions & 12 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,13 @@ local Pipeline(php_version, wp_version) =
tags: true
}
},
{
name: "install deps",
image: "quay.io/presslabs/build:latest",
environment: {
WP_CORE_DIR: "/workspace/presslabs/toplytics/wordpress",
WP_TEST_DIR: "/workspace/presslabs/toplytics/wordpress-test-lib",
},
commands: [
// install build deps
"make build.tools",
],
},
{
name: "test",
image: "docker.io/presslabs/php-runtime:%s" % php_version,
user: "root",
environment: {
WORDPRESS_TEST_DB_HOST: "database"
},
commands: [
"make test WP_VERSION=%s" % wp_version,
],
Expand Down
10 changes: 3 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ steps:
settings:
depth: 0
tags: true
- commands:
- make build.tools
environment:
WP_CORE_DIR: /workspace/presslabs/toplytics/wordpress
WP_TEST_DIR: /workspace/presslabs/toplytics/wordpress-test-lib
image: quay.io/presslabs/build:latest
name: install deps
- commands:
- make test WP_VERSION=6.0.1
environment:
WORDPRESS_TEST_DB_HOST: database
image: docker.io/presslabs/php-runtime:8.0
name: test
user: root
- commands:
- /usr/local/bin/setup-credentials-helper.sh
group: publish
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ include build/makelib/common.mk
include build/makelib/wordpress.mk
include build/makelib/php.mk

.php.test.init: $(WP_TESTS_DIR)/src/wp-includes/version.php $(WP_TESTS_DIR)/includes $(WP_TESTS_DIR)/data
.php.test.init: $(WP_TESTS_DIR)/wp-tests-config.php $(WP_TESTS_DIR)/includes $(WP_TESTS_DIR)/data
@composer install --no-dev --no-interaction || $(FAIL)
@mv vendor src/
@composer install --no-interaction || $(FAIL)
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
}
],
"require": {
"php": "~7.0",
"google/apiclient": "^2.10"
"php": ">=7.4 <=8.1",
"google/apiclient": "^2.12"
},
"require-dev": {
"phpunit/phpunit": "<8",
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/testtest.php';
require dirname( dirname( __FILE__ ) ) . '/src/toplytics.php';
}

tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Expand Down
9 changes: 4 additions & 5 deletions tests/wp-tests-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
* DO NOT use a production database or one that is shared with something else.
*/

define( 'DB_NAME', 'wordpress_test' );
define( 'DB_USER', 'wordpress' );
define( 'DB_PASSWORD', 'wordpress' );
define( 'DB_HOST', 'localhost' );
define( 'DB_HOST', getenv('WORDPRESS_TEST_DB_HOST', true) ?: '127.0.0.1' );
define( 'DB_NAME', getenv('WORDPRESS_TEST_DB_NAME', true) ?: 'wordpress_test' );
define( 'DB_USER', getenv('WORDPRESS_TEST_DB_USER', true) ?: 'wordpress' );
define( 'DB_PASSWORD', getenv('WORDPRESS_TEST_DB_PASSWORD') ?: 'wordpress' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );

/**#@+
* Authentication Unique Keys and Salts.
*
Expand Down

0 comments on commit e3ab1fc

Please sign in to comment.