-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into unskip-waf-blocking-tests-for-ruby
- Loading branch information
Showing
7 changed files
with
131 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
Three decorators allow you to skip test functions or classes for a library: | ||
|
||
* `@irrelevant`: The tested feature/behavior is irrelevant to the library, meaning the feature is either purposefully not supported by the lib or cannot reasonably be implemented | ||
* `@bug`: The lib does not implement the feature correctly/up to spec | ||
* `@missing_feature`: The tested feature/behavior does not exist in the library or there is a deficit in the test library that blocks this test from executing for the lib. **The test will be executed** and being ignored if it fails. If it passes, a warning will be added in thee output (`XPASS`) | ||
* `@bug`: The lib does not implement the feature correctly/up to spec. **The test will be executed** and being ignored if it fails. If it passes, a warning will be added in thee output (`XPASS`) | ||
* `@flaky` (subclass of `bug`): The feature sometimes fails, sometimes passes. It's not reliable, so don't run it. | ||
* `@missing_feature`: The tested feature/behavior does not exist in the library or there is a deficit in the test library that blocks this test from executing for the lib | ||
|
||
To skip specific test functions within a test class, use them as in-line decorators (Example below). | ||
To skip test classes or test files, use the decorator in the library's [manifest file](./manifest.md). | ||
|
@@ -14,6 +14,7 @@ The decorators take several arguments: | |
* `library`: provide library. version numbers are allowed e.g.`[email protected]`, see [versions.md](./versions.md) for more details on semantic versioning and testing against unmerged changes | ||
* `weblog_variant`: if you want to skip the test for a specific weblog | ||
* `reason`: why the test is skipped. It's especially useful for `@bug`, in which case the value should reference a JIRA ticket number. | ||
* `force_skip`: if you want to not execute a test maked with `missing_feature` or `bug` (main reason it entirely break the app), you can set `force_skip` to `True` | ||
|
||
|
||
```python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
console.log('Child process started'); | ||
|
||
setTimeout(() => { | ||
setTimeout(function () { | ||
console.log('Child process exiting after 5 seconds'); | ||
process.kill(process.pid, 'SIGSEGV'); | ||
}, 5000); // Add a delay before crashing otherwise the telemetry forwarder leaves a zombie behind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from utils import bug, missing_feature, scenarios | ||
|
||
from .utils import run_system_tests | ||
|
||
FILENAME = "tests/test_the_test/test_force_skip.py" | ||
|
||
|
||
@scenarios.test_the_test | ||
class Test_ForceSkip: | ||
def test_force_bug(self): | ||
tests = run_system_tests(test_path=FILENAME) | ||
|
||
nodeid = f"{FILENAME}::Test_Bug::test_bug_executed" | ||
assert tests[nodeid]["outcome"] == "xpassed" | ||
|
||
nodeid = f"{FILENAME}::Test_Bug::test_missing_feature_executed" | ||
assert tests[nodeid]["outcome"] == "xpassed" | ||
|
||
nodeid = f"{FILENAME}::Test_Bug::test_bug_not_executed" | ||
assert tests[nodeid]["outcome"] == "skipped" | ||
|
||
nodeid = f"{FILENAME}::Test_Bug::test_missing_feature_not_executed" | ||
assert tests[nodeid]["outcome"] == "skipped" | ||
|
||
|
||
@scenarios.mock_the_test | ||
class Test_Bug: | ||
@bug(True) | ||
def test_bug_executed(self): | ||
assert True | ||
|
||
@missing_feature(True) | ||
def test_missing_feature_executed(self): | ||
assert True | ||
|
||
@bug(True, force_skip=True) | ||
def test_bug_not_executed(self): | ||
assert True | ||
|
||
@missing_feature(True, force_skip=True) | ||
def test_missing_feature_not_executed(self): | ||
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs-08.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
lang_variant: | ||
name: node08 | ||
version: 0.8 | ||
cache: true | ||
install: | ||
- os_type: linux | ||
remote-command: | | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
nvm install --no-progress 0.8 | ||
nvm use node | ||
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local | ||
weblog: | ||
name: test-app-nodejs-08 | ||
exact_os_branches: [ubuntu20_amd64, centos_7_amd64] | ||
install: | ||
- os_type: linux | ||
copy_files: | ||
- name: copy-service | ||
local_path: utils/build/virtual_machine/weblogs/common/test-app.service | ||
|
||
- name: copy-service-run-script | ||
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_service.sh | ||
|
||
- name: copy-run-weblog-script | ||
local_path: utils/build/virtual_machine/weblogs/nodejs/test-app-nodejs/test-app-nodejs_run.sh | ||
|
||
- name: copy-binary | ||
local_path: lib-injection/build/docker/nodejs/sample-app/index.js | ||
|
||
remote-command: sh test-app-nodejs_run.sh |