-
Notifications
You must be signed in to change notification settings - Fork 800
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
Adding a skeleton of wpcomsh to experiment with running tests. #35792
Changes from all commits
ea1c9aa
2e74591
f735c3d
f0ca110
8b34e43
34adcfb
edc9fea
5fe70d5
780f9d5
b97785e
e7a7bef
3d7d3ce
016422d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,16 @@ | |
'with-woocommerce' => true, | ||
); | ||
|
||
// Add WooCommerce tests. | ||
$matrix[] = array( | ||
'name' => 'PHP tests: PHP 7.4 WP latest with WPCOMSH', | ||
'script' => 'test-php', | ||
'php' => '8.1', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we can avoid hard-coding 8.1 here, to avoid having to remember to update this in the future when Atomic's minimum PHP version changes. Might it make sense to read wpcomsh's composer.json for |
||
'wp' => 'latest', | ||
'timeout' => 20, | ||
'with-wpcomsh' => true, | ||
); | ||
|
||
// Add JS tests. | ||
$matrix[] = array( | ||
'name' => 'JS tests', | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -160,6 +160,16 @@ if [[ "$WITH_WOOCOMMERCE" == true ]]; then | |||||
echo "::endgroup::" | ||||||
fi | ||||||
|
||||||
# Install WooCommerce plugin used for some Jetpack integration tests. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if [[ "$WITH_WPCOMSH" == true ]]; then | ||||||
echo "::group::Installing wpcomsh into WordPress" | ||||||
|
||||||
mkdir "/tmp/wordpress-$WP_BRANCH/src/wp-content/mu-plugins" | ||||||
cp -r "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/wpcomsh/src" "/tmp/wordpress-$WP_BRANCH/src/wp-content/mu-plugins/wpcomsh" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems wrong. If we need to move it into mu-plugins at all, it should probably be like this
Suggested change
|
||||||
|
||||||
echo "::endgroup::" | ||||||
fi | ||||||
|
||||||
cd "/tmp/wordpress-$WP_BRANCH" | ||||||
|
||||||
cp wp-tests-config-sample.php wp-tests-config.php | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ jobs: | |
NODE_VERSION: ${{ matrix.node }} | ||
MONOREPO_BASE: ${{ github.workspace }} | ||
WITH_WOOCOMMERCE: ${{ matrix.with-woocommerce }} | ||
WITH_WPCOMSH: ${{ matrix.with-wpcomsh }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will you need something below around line 86 as well? |
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: other | ||
|
||
Added ability to test Jetpack together with wpcomsh. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Files not needed to be distributed in the package. | ||
.gitattributes export-ignore | ||
.github/ export-ignore | ||
package.json export-ignore | ||
|
||
# Files to include in the mirror repo, but excluded via gitignore | ||
# Remember to end all directories with `/**` to properly tag every file. | ||
# /src/js/example.min.js production-include | ||
|
||
# Files to exclude from the mirror repo, but included in the monorepo. | ||
# Remember to end all directories with `/**` to properly tag every file. | ||
.gitignore production-exclude | ||
changelog/** production-exclude | ||
phpunit.xml.dist production-exclude | ||
tests/** production-exclude |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
vendor/ | ||
node_modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# wpcomsh | ||
|
||
A helper for connecting WordPress.com sites to external host infrastructure. | ||
|
||
## How to install wpcomsh | ||
|
||
### Installation From Git Repo | ||
|
||
## Contribute | ||
|
||
## Get Help | ||
|
||
## Using this package in your WordPress plugin | ||
|
||
If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well. | ||
|
||
## Security | ||
|
||
Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic). | ||
|
||
## License | ||
|
||
wpcomsh is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: added | ||
|
||
Initial version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "automattic/jetpack-wpcomsh", | ||
"description": "A helper for connecting WordPress.com sites to external host infrastructure.", | ||
"type": "wordpress-plugin", | ||
"license": "GPL-2.0-or-later", | ||
"require": {}, | ||
"require-dev": { | ||
"yoast/phpunit-polyfills": "1.1.0", | ||
"automattic/jetpack-changelogger": "@dev", | ||
"automattic/wordbless": "dev-master" | ||
}, | ||
"autoload": { | ||
"classmap": [ | ||
"src/" | ||
] | ||
}, | ||
"scripts": { | ||
"phpunit": [ | ||
"./vendor/phpunit/phpunit/phpunit --colors=always" | ||
], | ||
"test-php": [ | ||
"@composer phpunit" | ||
], | ||
"build-production": "echo 'Add your build step to composer.json, please!'", | ||
"build-development": "echo 'Add your build step to composer.json, please!'", | ||
"post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", | ||
"post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../../packages/*", | ||
"options": { | ||
"monorepo": true | ||
} | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"config": { | ||
"allow-plugins": { | ||
"roots/wordpress-core-installer": true | ||
} | ||
}, | ||
"extra": { | ||
"release-branch-prefix": "wpcomsh", | ||
"changelogger": { | ||
"versioning": "semver" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"private": true, | ||
"name": "@automattic/jetpack-wpcomsh", | ||
"version": "0.1.0-alpha", | ||
"description": "A helper for connecting WordPress.com sites to external host infrastructure.", | ||
"homepage": "https://jetpack.com", | ||
"bugs": { | ||
"url": "https://github.com/Automattic/jetpack/labels/[Plugin] Wpcomsh" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Automattic/jetpack.git", | ||
"directory": "projects/plugins/wpcomsh" | ||
}, | ||
"license": "GPL-2.0-or-later", | ||
"author": "Automattic", | ||
"scripts": { | ||
"build": "echo 'Not implemented.'", | ||
"build-js": "echo 'Not implemented.'", | ||
"build-production": "echo 'Not implemented.'", | ||
"build-production-js": "echo 'Not implemented.'", | ||
"clean": "true" | ||
}, | ||
"devDependencies": {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<phpunit bootstrap="tests/php/bootstrap.php" backupGlobals="false" colors="true" convertDeprecationsToExceptions="true"> | ||
<testsuites> | ||
<testsuite name="main"> | ||
<directory prefix="test" suffix=".php">tests/php</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="false"> | ||
<!-- Better to only include "src" than to add "." and then exclude "tests", "vendor", and so on, as PHPUnit still scans the excluded directories. --> | ||
<!-- Add additional lines for any files or directories outside of src/ that need coverage. --> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
== Description == | ||
|
||
Longer description of the plugin. | ||
|
||
== Installation == | ||
|
||
Installation instructions go here. | ||
|
||
== Frequently Asked Questions == | ||
|
||
= A question that someone might have = | ||
|
||
An answer to that question. | ||
|
||
== Screenshots == | ||
|
||
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from | ||
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets | ||
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png` | ||
(or jpg, jpeg, gif). | ||
2. This is the second screen shot | ||
|
||
== Changelog == | ||
|
||
<!-- When you do a release, use the monorepo script tools/plugin-changelog-to-readme.sh to copy from CHANGELOG.md to here. --> | ||
|
||
== Arbitrary section == | ||
|
||
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated | ||
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or | ||
"installation." Arbitrary sections will be shown below the built-in sections outlined above. | ||
|
||
== A brief Markdown Example == | ||
|
||
Ordered list: | ||
|
||
1. Some feature | ||
1. Another feature | ||
1. Something else about the plugin | ||
|
||
Unordered list: | ||
|
||
* something | ||
* something else | ||
* third thing | ||
|
||
Here's a link to [WordPress](https://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax]. | ||
Titles are optional, naturally. | ||
|
||
[markdown syntax]: http://daringfireball.net/projects/markdown/syntax | ||
"Markdown is what the parser uses to process much of the readme file" | ||
|
||
Markdown uses email style notation for blockquotes and I've been told: | ||
> Asterisks for *emphasis*. Double it up for **strong**. | ||
|
||
`<?php code(); // goes in backticks ?>` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* Put your classes in this `src` folder! | ||
* | ||
* @package automattic/PACKAGE-NAME | ||
*/ | ||
|
||
// Start your code here! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.