Skip to content

Commit ecbb74c

Browse files
committed
Docker configuration updated
1 parent e27367e commit ecbb74c

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

.env.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ TESTS_ENVS=tests/_envs
2828

2929
CORE_BRANCH=develop
3030
JWT_AUTH_BRANCH=master
31-
SKIP_PCOV_CLOBBER_CLEANUP=false
31+
SKIP_TEST_CLEANUP=0

bin/testing-entrypoint.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ dockerize \
4444
-timeout 1m
4545

4646
# Download c3 for testing.
47-
if [ ! -f "${PROJECT_DIR}/c3.php" ]; then
48-
echo 'Downloading c3.php'
49-
curl -L 'https://raw.github.com/Codeception/c3/2.0/c3.php' > "${PROJECT_DIR}/c3.php"
47+
if [ ! -f "$PROJECT_DIR/c3.php" ]; then
48+
echo "Downloading Codeception's c3.php"
49+
curl -L 'https://raw.github.com/Codeception/c3/2.0/c3.php' > "$PROJECT_DIR/c3.php"
5050
fi
5151

5252
# Install dependencies
@@ -68,14 +68,20 @@ chmod 777 ${TESTS_OUTPUT}
6868
# Run tests
6969
run_tests ${SUITES}
7070

71+
# Remove c3.php
72+
if [ -f "$PROJECT_DIR/c3.php" ] && [ "$SKIP_TESTS_CLEANUP" != "1" ]; then
73+
echo "Removing Codeception's c3.php"
74+
rm -rf "$PROJECT_DIR/c3.php"
75+
fi
76+
7177
# Clean coverage.xml and clean up PCOV configurations.
7278
if [ -f "${TESTS_OUTPUT}/coverage.xml" ] && [[ "$COVERAGE" == "1" ]]; then
7379
echo 'Cleaning coverage.xml for deployment'.
7480
pattern="$PROJECT_DIR/"
7581
sed -i "s~$pattern~~g" "$TESTS_OUTPUT"/coverage.xml
7682

7783
# Remove pcov/clobber
78-
if version_gt $PHP_VERSION 7.0 && [ ${SKIP_PCOV_CLOBBER_CLEANUP} != "true" ]; then
84+
if version_gt $PHP_VERSION 7.0 && [ "$SKIP_TESTS_CLEANUP" != "1" ]; then
7985
echo 'Removing pcov/clobber.'
8086
vendor/bin/pcov unclobber
8187
COMPOSER_MEMORY_LIMIT=-1 composer remove --dev pcov/clobber

codeception.dist.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ settings:
1414
coverage:
1515
enabled: true
1616
remote: false
17-
work_dir: '%WP_ROOT_FOLDER%/wp-content/plugins/wp-graphql-woocommerce'
1817
c3_url: '%WP_URL%/wp-content/plugins/wp-graphql-woocommerce/wp-graphql-woocommerce.php'
19-
whitelist:
20-
include:
18+
include:
19+
- includes/*
20+
exclude:
2121
- wp-graphql-woocommerce.php
2222
- access-functions.php
2323
- class-inflect.php
24-
- includes/*.php
25-
remote_context_options:
26-
http:
27-
timeout: 90
24+
- vendor/*
25+
show_only_summary: false
2826
extensions:
2927
enabled:
3028
- Codeception\Extension\RunFailed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ services:
4949
- './.log/testing:/var/log/apache2'
5050
env_file: .env.dist
5151
environment:
52+
XDEBUG_CONFIG: remote_host=host.docker.internal remote_port=9000 remote_enable=1
5253
WPGRAPHQL_WOOCOMMERCE_AUTOLOAD: 1
5354
DB_HOST: app_db
5455
WP_URL: 'http://localhost'

tests/_support/Helper/GraphQLE2E.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,8 @@ public function sendGraphQLRequest( $query, $input, $request_headers = array() )
598598
}
599599

600600
// Send request.
601-
$wp_url = getenv( 'WP_URL' );
602601
$rest->sendPOST(
603-
"{$wp_url}/graphql",
602+
"/graphql",
604603
json_encode(
605604
array(
606605
'query' => $query,

wp-graphql-woocommerce.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
*
2727
* This file should only exist locally or when CI bootstraps the environment for testing
2828
*/
29-
if ( file_exists( plugin_dir_path( __FILE__ ) . '/c3.php' ) ) {
29+
if ( file_exists( __DIR__ . '/c3.php' ) ) {
3030
// Get tests output directory.
31-
$test_dir = plugin_dir_path( __FILE__ ) . '/tests/output';
31+
$test_dir = __DIR__ . '/tests/output';
3232
define( 'C3_CODECOVERAGE_ERROR_LOG_FILE', $test_dir . '/c3_error.log' );
33-
require_once plugin_dir_path( __FILE__ ) . '/c3.php';
33+
require_once __DIR__ . '/c3.php';
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)