Skip to content

Commit

Permalink
Update references to woocommerce_payments_server (#9824)
Browse files Browse the repository at this point in the history
  • Loading branch information
achyuthajoy committed Nov 28, 2024
1 parent dcfef91 commit 793047f
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 49 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/e2e-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ on:
description: "Branch to be used for running tests"

env:
E2E_GH_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
WCP_DEV_TOOLS_REPO: ${{ secrets.WCP_DEV_TOOLS_REPO }}
WCP_DEV_TOOLS_BRANCH: 'trunk'
WCP_SERVER_REPO: ${{ secrets.WCP_SERVER_REPO }}
WC_SUBSCRIPTIONS_REPO: ${{ secrets.WC_SUBSCRIPTIONS_REPO }}
E2E_BLOG_ID: ${{ secrets.E2E_BLOG_ID }}
E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }}
E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }}
WC_E2E_SCREENSHOTS: 1
E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }}
E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
E2E_USE_LOCAL_SERVER: false
E2E_RESULT_FILEPATH: 'tests/e2e/results.json'
WCPAY_USE_BUILD_ARTIFACT: ${{ inputs.wcpay-use-build-artifact }}
WCPAY_ARTIFACT_DIRECTORY: 'zipfile'
NODE_ENV: 'test'
FORCE_E2E_DEPS_SETUP: true
E2E_GH_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
WCP_DEV_TOOLS_REPO: ${{ secrets.WCP_DEV_TOOLS_REPO }}
WCP_DEV_TOOLS_BRANCH: 'trunk'
TRANSACT_PLATFORM_SERVER_REPO: ${{ secrets.TRANSACT_PLATFORM_SERVER_REPO }}
WC_SUBSCRIPTIONS_REPO: ${{ secrets.WC_SUBSCRIPTIONS_REPO }}
E2E_BLOG_ID: ${{ secrets.E2E_BLOG_ID }}
E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }}
E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }}
WC_E2E_SCREENSHOTS: 1
E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }}
E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
E2E_USE_LOCAL_SERVER: false
E2E_RESULT_FILEPATH: 'tests/e2e/results.json'
WCPAY_USE_BUILD_ARTIFACT: ${{ inputs.wcpay-use-build-artifact }}
WCPAY_ARTIFACT_DIRECTORY: 'zipfile'
NODE_ENV: 'test'
FORCE_E2E_DEPS_SETUP: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-pw-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
E2E_GH_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
WCP_DEV_TOOLS_REPO: ${{ secrets.WCP_DEV_TOOLS_REPO }}
WCP_DEV_TOOLS_BRANCH: 'trunk'
WCP_SERVER_REPO: ${{ secrets.WCP_SERVER_REPO }}
TRANSACT_PLATFORM_SERVER_REPO: ${{ secrets.TRANSACT_PLATFORM_SERVER_REPO }}
WC_SUBSCRIPTIONS_REPO: ${{ secrets.WC_SUBSCRIPTIONS_REPO }}
E2E_BLOG_ID: ${{ secrets.E2E_BLOG_ID }}
E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ on:
workflow_dispatch:

env:
E2E_GH_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
WCP_DEV_TOOLS_REPO: ${{ secrets.WCP_DEV_TOOLS_REPO }}
WCP_DEV_TOOLS_BRANCH: 'trunk'
WCP_SERVER_REPO: ${{ secrets.WCP_SERVER_REPO }}
WC_SUBSCRIPTIONS_REPO: ${{ secrets.WC_SUBSCRIPTIONS_REPO }}
E2E_BLOG_ID: ${{ secrets.E2E_BLOG_ID }}
E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }}
E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }}
WC_E2E_SCREENSHOTS: 1
E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }}
E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
E2E_USE_LOCAL_SERVER: false
E2E_RESULT_FILEPATH: 'tests/e2e/results.json'
WC_MIN_SUPPORTED_VERSION: '7.6.0'
NODE_ENV: 'test'
FORCE_E2E_DEPS_SETUP: true
E2E_GH_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
WCP_DEV_TOOLS_REPO: ${{ secrets.WCP_DEV_TOOLS_REPO }}
WCP_DEV_TOOLS_BRANCH: 'trunk'
TRANSACT_PLATFORM_SERVER_REPO: ${{ secrets.TRANSACT_PLATFORM_SERVER_REPO }}
WC_SUBSCRIPTIONS_REPO: ${{ secrets.WC_SUBSCRIPTIONS_REPO }}
E2E_BLOG_ID: ${{ secrets.E2E_BLOG_ID }}
E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }}
E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }}
WC_E2E_SCREENSHOTS: 1
E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }}
E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
E2E_USE_LOCAL_SERVER: false
E2E_RESULT_FILEPATH: 'tests/e2e/results.json'
WC_MIN_SUPPORTED_VERSION: '7.6.0'
NODE_ENV: 'test'
FORCE_E2E_DEPS_SETUP: true

jobs:
generate-matrix:
Expand Down
5 changes: 5 additions & 0 deletions changelog/update-server-container-name
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Updates server container name used by E2E tests


12 changes: 6 additions & 6 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ DEBUG=false
---

<details>
<summary>Choose WCPay Server instance</summary>
<summary>Choose Transact Platform Server instance</summary>
<p>

It is possible to use the live server or a local docker instance of WCPay server locally. On Github Actions, live server is used for tests. Add the following env variables to your `local.env` based on your preference (replace values as required).
It is possible to use the live server or a local docker instance of Transact Platform Server locally. On Github Actions, live server is used for tests. Add the following env variables to your `local.env` based on your preference (replace values as required).

**Using Local Server on Docker**

By default, the local E2E environment is configured to use WCPay local server instance. Add the following env variables to configure the local server instance.
By default, the local E2E environment is configured to use Transact Platform local server instance. Add the following env variables to configure the local server instance.

```
# WooCommerce Payments Server Repo
WCP_SERVER_REPO='https://github.com/server-repo.git or [email protected]:org/server-repo.git'
# Transact Platform Server Repo
TRANSACT_PLATFORM_SERVER_REPO='https://github.com/server-repo.git or [email protected]:org/server-repo.git'
# Stripe account data. Need to support level 3 data to run tests successfully.
# These values can be obtained from the Stripe Dashboard: https://dashboard.stripe.com/test/apikeys
Expand Down Expand Up @@ -135,7 +135,7 @@ E2E_WC_VERSION='<woocommerce_version>'
- WC E2E Client: http://localhost:8084
- WC E2E Server: http://localhost:8088 (Available only when using local server)

**Note:** Be aware that the server port may change in the `docker-compose.e2e.yml` configuration, so when you can't access the server, try running `docker port woocommerce_payments_server_wordpress_e2e 80` to find out the bound port of the E2E server container.
**Note:** Be aware that the server port may change in the `docker-compose.e2e.yml` configuration, so when you can't access the server, try running `docker port transact_platform_server_wordpress_e2e 80` to find out the bound port of the E2E server container.

</p>
</details>
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/env/down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ docker compose -f $E2E_ROOT/env/docker-compose.yml down

if [[ "$E2E_USE_LOCAL_SERVER" != false ]]; then
step "Stopping server containers"
docker compose -f $E2E_ROOT/deps/wcp-server/docker-compose.yml down
docker compose -f $E2E_ROOT/deps/transact-platform-server/docker-compose.yml down
fi

# Remove auth credentials from the Playwright config.
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/env/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ if [[ $FORCE_E2E_DEPS_SETUP ]]; then
sudo rm -rf tests/e2e/deps
fi

# Setup WCPay local server instance.
# Setup Transact Platform local server instance.
# Only if E2E_USE_LOCAL_SERVER is present & equals to true.
if [[ "$E2E_USE_LOCAL_SERVER" != false ]]; then
if [[ ! -d "$SERVER_PATH" ]]; then
step "Fetching server (branch ${WCP_SERVER_BRANCH-trunk})"
step "Fetching server (branch ${TRANSACT_PLATFORM_SERVER_BRANCH-trunk})"

if [[ -z $WCP_SERVER_REPO ]]; then
echo "WCP_SERVER_REPO env variable is not defined"
if [[ -z $TRANSACT_PLATFORM_SERVER_REPO ]]; then
echo "TRANSACT_PLATFORM_SERVER_REPO env variable is not defined"
exit 1;
fi

rm -rf "$SERVER_PATH"
git clone --depth=1 --branch "${WCP_SERVER_BRANCH-trunk}" "$WCP_SERVER_REPO" "$SERVER_PATH"
git clone --depth=1 --branch "${TRANSACT_PLATFORM_SERVER_BRANCH-trunk}" "$TRANSACT_PLATFORM_SERVER_REPO" "$SERVER_PATH"
else
echo "Using cached server at ${SERVER_PATH}"
fi
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/env/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ cwd=$(pwd)
export WCP_ROOT=$cwd
export E2E_ROOT="$cwd/tests/e2e"
export WP_URL="localhost:8084"
export SERVER_PATH="$E2E_ROOT/deps/wcp-server"
export SERVER_CONTAINER="woocommerce_payments_server_wordpress_e2e"
export SERVER_PATH="$E2E_ROOT/deps/transact-platform-server"
export SERVER_CONTAINER="transact_platform_server_wordpress_e2e"
export DEV_TOOLS_DIR="wcp-dev-tools"
export DEV_TOOLS_PATH="$E2E_ROOT/deps/$DEV_TOOLS_DIR"
export CLIENT_CONTAINER="wcp_e2e_wordpress"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/env/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ docker compose -f "$E2E_ROOT/env/docker-compose.yml" up -d

if [[ "$E2E_USE_LOCAL_SERVER" != false ]]; then
step "Starting server containers"
docker compose -f "$E2E_ROOT/deps/wcp-server/docker-compose.yml" up -d
docker compose -f "$E2E_ROOT/deps/transact-platform-server/docker-compose.yml" up -d
fi

0 comments on commit 793047f

Please sign in to comment.