Skip to content

Commit ee7ef86

Browse files
authored
Treat an archive without a version as trunk (#86)
1 parent 6930600 commit ee7ef86

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎bin/bootstrap-test-suite‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ set -e
2828

2929
BUILD_DIR="$(pwd)"
3030

31+
# An archive supplied through WP_CLI_TEST_CORE_ZIP is usually a development build,
32+
# which has no version to resolve against WordPress.org. Treat it as trunk, so that
33+
# no version specific scenarios are skipped. Set WP_VERSION explicitly when the
34+
# archive holds a specific release.
35+
if [ -z "$WP_VERSION" ] && [ -n "$WP_CLI_TEST_CORE_ZIP" ]; then
36+
export WP_VERSION="trunk"
37+
fi
38+
3139
if [ -z "$WP_VERSION" ]; then
3240
export WP_VERSION="latest"
3341
fi

‎bin/run-test-suite‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ set -e
2828

2929
export BUILD_DIR="${TRAVIS_BUILD_DIR:-$(pwd)}"
3030

31+
# An archive supplied through WP_CLI_TEST_CORE_ZIP is usually a development build,
32+
# which has no version to resolve against WordPress.org. Treat it as trunk, so that
33+
# no version specific scenarios are skipped. Set WP_VERSION explicitly when the
34+
# archive holds a specific release.
35+
if [ -z "$WP_VERSION" ] && [ -n "$WP_CLI_TEST_CORE_ZIP" ]; then
36+
export WP_VERSION="trunk"
37+
fi
38+
3139
if [ -z "$WP_VERSION" ]; then
3240
export WP_VERSION="latest"
3341
fi

‎bin/test-source‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ if [ -z "$BUILD_DIR" ]; then
3030
export BUILD_DIR="${GITHUB_WORKSPACE:-$(pwd)}"
3131
fi
3232

33+
# An archive supplied through WP_CLI_TEST_CORE_ZIP is usually a development build,
34+
# which has no version to resolve against WordPress.org. Treat it as trunk, so that
35+
# no version specific scenarios are skipped. Set WP_VERSION explicitly when the
36+
# archive holds a specific release. Older versions of wp-cli/wp-cli-tests resolve
37+
# an unset WP_VERSION to the latest release, so this cannot be left to them.
38+
if [ -z "$WP_VERSION" ] && [ -n "$WP_CLI_TEST_CORE_ZIP" ]; then
39+
export WP_VERSION="trunk"
40+
fi
41+
3342
if [ -z "$TEST_PACKAGE" -o "$TEST_PACKAGE" == "none" ]; then
3443
echo "Skipping feature tests completely."
3544
exit 0

0 commit comments

Comments
 (0)