@@ -22,61 +22,18 @@ echo "Running E2E tests..."
2222# Change to project root directory to build plugin
2323cd " $WCP_ROOT "
2424
25- # Foundation version: Simplified build process - just ensure we have a zip
26- # Compute a signature of sources relevant to the release build and
27- # skip rebuilding if nothing has changed since the last build.
28- compute_build_signature () {
29- # Hash tracked files that affect the release artifact. This includes
30- # sources packaged in the zip and build/config files that affect the output.
31- git ls-files -z -- \
32- assets \
33- i18n \
34- includes \
35- languages \
36- lib \
37- src \
38- templates \
39- client \
40- tasks/release.js \
41- webpack \
42- webpack.config.js \
43- babel.config.js \
44- package.json \
45- package-lock.json \
46- composer.json \
47- composer.lock \
48- woocommerce-payments.php \
49- changelog.txt \
50- readme.txt \
51- SECURITY.md \
52- 2> /dev/null \
53- | xargs -0 shasum -a 256 2> /dev/null \
54- | shasum -a 256 \
55- | awk ' {print $1}'
56- }
25+ # Foundation version: Simplified build process for easier testing
26+ # For this foundation PR, we'll always build to avoid complex signature computation issues
5727
5828BUILD_HASH_FILE=" $WCP_ROOT /woocommerce-payments.zip.hash"
5929
60- CURRENT_SIG=" $( compute_build_signature) "
61-
62- # If WCP_FORCE_BUILD is set, always rebuild
63- if [[ -n " ${WCP_FORCE_BUILD:- } " ]]; then
64- echo " WCP_FORCE_BUILD set; forcing build of WooPayments plugin..."
65- npm run build:release
66- echo " $CURRENT_SIG " > " $BUILD_HASH_FILE "
67- elif [[ -f " woocommerce-payments.zip" && -f " $BUILD_HASH_FILE " ]]; then
68- LAST_SIG=" $( cat " $BUILD_HASH_FILE " 2> /dev/null || true) "
69- if [[ " $CURRENT_SIG " == " $LAST_SIG " && -n " $CURRENT_SIG " ]]; then
70- echo " No relevant changes detected since last build; skipping build."
71- else
72- echo " Changes detected; rebuilding WooPayments plugin..."
73- npm run build:release
74- echo " $CURRENT_SIG " > " $BUILD_HASH_FILE "
75- fi
76- else
30+ # For this foundation PR, always build if zip doesn't exist or if forced
31+ if [[ -n " ${WCP_FORCE_BUILD:- } " ]] || [[ ! -f " woocommerce-payments.zip" ]]; then
7732 echo " Building WooPayments plugin..."
7833 npm run build:release
79- echo " $CURRENT_SIG " > " $BUILD_HASH_FILE "
34+ echo " foundation-build-$( date +%s) " > " $BUILD_HASH_FILE "
35+ else
36+ echo " Using existing woocommerce-payments.zip"
8037fi
8138
8239# Change to QIT directory so qit.yml is automatically found
8946 QIT_CMD=" $QIT_BINARY "
9047fi
9148
92- # Pass basic Jetpack environment variables
93- env_args=()
94- if [[ -n " ${E2E_JP_SITE_ID:- } " ]]; then
95- env_args+=( --env " E2E_JP_SITE_ID=${E2E_JP_SITE_ID} " )
96- fi
97- if [[ -n " ${E2E_JP_BLOG_TOKEN:- } " ]]; then
98- env_args+=( --env " E2E_JP_BLOG_TOKEN=${E2E_JP_BLOG_TOKEN} " )
99- fi
100- if [[ -n " ${E2E_JP_USER_TOKEN:- } " ]]; then
101- env_args+=( --env " E2E_JP_USER_TOKEN=${E2E_JP_USER_TOKEN} " )
102- fi
49+ echo " Running QIT E2E foundation tests (no Jetpack credentials)..."
10350
10451# Run our QIT E2E tests (qit.yml automatically loaded from current directory)
105- echo " Running QIT E2E foundation tests..."
106- if [ ${# env_args[@]} -eq 0 ]; then
107- " $QIT_CMD " run:e2e woocommerce-payments ./e2e \
108- --source " $WCP_ROOT /woocommerce-payments.zip"
109- else
110- " $QIT_CMD " run:e2e woocommerce-payments ./e2e \
111- --source " $WCP_ROOT /woocommerce-payments.zip" \
112- " ${env_args[@]} "
113- fi
52+ " $QIT_CMD " run:e2e woocommerce-payments ./e2e \
53+ --source " $WCP_ROOT /woocommerce-payments.zip"
11454
11555echo " QIT E2E foundation tests completed!"
0 commit comments