Closed Luc45 closed 6 months ago
Current Test coverage
Behavior | Covered by Tests |
---|---|
Env up with default settings | :heavy_check_mark: |
Env up with PHP and WP versions passed as parameters | :heavy_check_mark: |
Env up with PHP and WP versions in config file | :heavy_check_mark: |
Env up with PHP and WP versions in config file overridden by parameters | :heavy_check_mark: |
Env up with PHP and WP versions in config file overridden by config file override | :x: |
Env up with Object Cache | :heavy_check_mark: |
Env up with Additional Volumes | :x: |
Env up with WordPress version (stable/rc/tag) | :x: |
Env up with additional PHP Extensions | :x: |
Env up with additional theme(s) | :x: |
Upload test tag | :heavy_check_mark: |
List test tags | :heavy_check_mark: |
List test tags of a specific extension | :heavy_check_mark: |
Delete test tag | :heavy_check_mark: |
Upload, delete and list test tags of extension you don't own | :x: |
Scaffold a basic E2E test | :heavy_check_mark: |
Run a scaffolded E2E test locally | :heavy_check_mark: |
Tag a scaffolded test and run it from the tag | :heavy_check_mark: |
Run a test and assert it fails if SUT failed to activate | :heavy_check_mark: |
Run a scaffolded E2E test with additional plugin sourced from slug (activate action) | :heavy_check_mark: |
Run a scaffolded E2E test with additional plugin sourced from local directory/zip file/URL (activate/bootstrap/test actions), both from runtime parameters, config files and config file override | :x: |
Run a test with multiple plugins, some of them with tests, some with local directory and others from tags | :x: |
Test coverage April 26th
Nice!!
Hi @Luc45 - I have tested both PRs and noticed some issues while running the different commands:
./vendor/bin/paratest
🔴Howdy @rcstr , can you please confirm that your local Manager is in the correct branch (the counterpart of this one on the Manager repo)? And when you do your manual test where run:e2e
is not available, are you connected to the Local instance of that Manager?
For the self-tests part (not manual testing), I can see some things:
Failed to remove directory "/Users/rommel/Projects/qit-cli/_tests/custom_tests/tmp/tmp_qit_config-qit_custom_tests_66393a99f183f": rmdir(/Users/rommel/Projects/qit-cli/_tests/custom_tests/tmp/._YUT): Directory not empty
This is probably a racing condition where we invoke the method to delete the tmp
directory (recursively), but ._YUT
still exists, which seems to be resource forks from macOS. Reference 1, Reference 2
macOS stores metadata and resource forks using a technique called AppleDouble, in which the data fork is written as one file, and the resource fork and metadata are written as an entirely separate file preceded by a "._" naming convention. For example: ExampleFile.psd would contain the data fork, and ._ExampleFile.psd would contain the resource fork and metadata.
I think this only happens on the context of self-tests. I'll add a small workaround (probably a 250ms wait before deleting) to see if it addresses it in the context of self-tests.
I won't change anything in the actual production flow, so if there's a bug there about this it will continue to happen on Mac and we can catch it.
As for this failure:
+\n
+What's Next?\n
+View summary of image vulnerabilities and recommendations → docker scout quickview automattic/qit-runner-playwright:1.42.1\n
From the snapshot tests it seems your instance of Docker adds some unexpected output to the terminal, which is nice to catch. I'll add a DOCKER_CLI_HINTS=false
env var before running things to normalize this output.
Custom Tests
This PR allows Partner developers of the Woo marketplace to submit their own E2E tests to QIT, and to run the E2E tests that we make available to them.
Testing instructions
_tests/custom_tests
and runcomposer install
_tests/custom_tests/.env.sample
to_tests/custom_tests/.env
.env
with the necessary values./vendor/bin/paratest
, it should take around 5 minutes and passManual testing instructions
Explore the new commands added, which are:
Scaffold a test, upload it, list it and run it:
qit scaffold:e2e /tmp/foo
qit tag:upload automatewoo /tmp/foo
qit tag:list
qit run:e2e automatewoo --plugin woocommerce:activate
Publish another test tag
automatewoo-birthdays
qit run:e2e automatewoo-birthdays --plugin woocommerce:activate --plugin automatewoo:test
qit-env.yml
orqit-env.json
filesThere are many options, try out with
--php_version 8.3
, different WP and Woo versions, object cache, etc.Also try out
--codegen
and--ui
.The self-tests is pretty self-explanatory too, if you're interested. Check this out for instance:
Documentation:
The documentation contains example commands that we can use to try more scenarios: https://qit.woo.com/docs/custom-tests/introduction