Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crm: Set up infrastructure to run tests in CI #28354

Merged
merged 13 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/files/setup-wordpress-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# - WP_BRANCH: Version of WordPress to check out.
#
# Other:
# - GITHUB_PATH: File written to if set to propagate composer path.
# - GITHUB_ENV: File written to to set environment variables for later steps.

set -eo pipefail

Expand Down Expand Up @@ -52,6 +52,11 @@ rm -rf "/tmp/wordpress-$WP_BRANCH/src"
git clone --depth=1 --branch "$TAG" git://core.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH/src"
echo "::endgroup::"

if [[ -n "$GITHUB_ENV" ]]; then
echo "WORDPRESS_DEVELOP_DIR=/tmp/wordpress-$WP_BRANCH" >> "$GITHUB_ENV"
echo "WORDPRESS_DIR=/tmp/wordpress-$WP_BRANCH/src" >> "$GITHUB_ENV"
fi

# Don't symlink, it breaks when copied later.
export COMPOSER_MIRROR_PATH_REPOS=true

Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/crm/changelog/add-crm-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Copy tests from old repo.
13 changes: 11 additions & 2 deletions projects/plugins/crm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"name": "automattic/jetpackcrm",
"description": "[Jetpack CRM](https://jetpackcrm.com) Core CRM Plugin - WordPress.org Hosted",
"require-dev": {
"automattic/jetpack-changelogger": "@dev"
"automattic/jetpack-changelogger": "@dev",
"codeception/codeception": "^4.1",
"codeception/module-asserts": "^1.0",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-webdriver": "^1.0",
"codeception/module-db": "^1.0",
"codeception/module-filesystem": "^1.0",
"codeception/util-universalframework": "^1.0"
},
"scripts": {
"tests": "vendor/bin/codecept run acceptance --fail-fast",
Expand All @@ -12,7 +19,9 @@
"cs": "temp=$(git diff --diff-filter=d --name-only trunk HEAD | grep '.php'); [[ -n $temp ]] && phpcs-changed -s --always-exit-zero --git --git-base trunk $temp || echo 'No changes found.'",
"cs-security": "temp=$(git diff --diff-filter=d --name-only trunk HEAD | grep '.php'); [[ -n $temp ]] && phpcs-changed -s --standard=phpcs.security.xml$([[ ! -f phpcs.security.xml ]] && echo .dist) --always-exit-zero --git --git-base trunk $temp || echo 'No changes found.'",
"cs-staged": "temp=$(git diff --diff-filter=d --name-only --cached | grep '.php'); [[ -n $temp ]] && phpcs-changed -s --always-exit-zero --git --git-staged $temp || echo 'No changes found.'",
"cs-unstaged": "temp=$(git diff --diff-filter=d --name-only | grep '.php'); [[ -n $temp ]] && phpcs-changed -s --always-exit-zero --git --git-unstaged $temp || echo 'No changes found.'"
"cs-unstaged": "temp=$(git diff --diff-filter=d --name-only | grep '.php'); [[ -n $temp ]] && phpcs-changed -s --always-exit-zero --git --git-unstaged $temp || echo 'No changes found.'",
"test-php": "tests/action-test-php.sh",
"skip-test-php": "tests/action-skip-test-php.sh"
},
"config": {
"platform": {
Expand Down
Loading