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

OnBoarding: de-parametrize #3960

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
75d68cc
OnBoarding: de-parametrize
robertomonteromiguel Feb 3, 2025
626ad36
move virtual machines
robertomonteromiguel Feb 4, 2025
95dc8fe
define nodejs apps
robertomonteromiguel Feb 4, 2025
ead92b3
nodejs done
robertomonteromiguel Feb 5, 2025
c3c83e2
fix chaos scenario
robertomonteromiguel Feb 5, 2025
2b7a79e
fix container script scenarios and disable machines
robertomonteromiguel Feb 5, 2025
71ff7d2
merge main
robertomonteromiguel Feb 5, 2025
6a62dad
virtual machines in a json
robertomonteromiguel Feb 5, 2025
660425a
vms and workflow definitions
robertomonteromiguel Feb 7, 2025
0f564bb
remove matrix definition python file
robertomonteromiguel Feb 7, 2025
cf2e306
merge main
robertomonteromiguel Feb 7, 2025
2a6e5fb
format
robertomonteromiguel Feb 7, 2025
228a090
Merge branch 'main' into robertomonteromiguel/onboarding_deparametrize
robertomonteromiguel Feb 7, 2025
a2e6a45
fix script
robertomonteromiguel Feb 7, 2025
5e868ee
Merge branch 'main' into robertomonteromiguel/onboarding_deparametrize
robertomonteromiguel Feb 7, 2025
9191800
fix decorator
robertomonteromiguel Feb 7, 2025
ec6835c
fix pipeline
robertomonteromiguel Feb 7, 2025
ff1209f
forgotten change
robertomonteromiguel Feb 7, 2025
62005f5
remove disabled machines
robertomonteromiguel Feb 7, 2025
aa0d3a3
format
robertomonteromiguel Feb 7, 2025
2f52d82
fix condition
robertomonteromiguel Feb 7, 2025
8e2ffe3
fix condition
robertomonteromiguel Feb 7, 2025
57a1452
fix pipeline genration
robertomonteromiguel Feb 7, 2025
207be43
fixes
robertomonteromiguel Feb 7, 2025
9fc4290
fix aws volume size
robertomonteromiguel Feb 7, 2025
cb4ef87
launch again
robertomonteromiguel Feb 7, 2025
830d591
add wizard script
robertomonteromiguel Feb 7, 2025
7fbec09
better error handling
robertomonteromiguel Feb 7, 2025
7d932e9
revert provision test change
robertomonteromiguel Feb 7, 2025
aea449d
lint
robertomonteromiguel Feb 7, 2025
d4bc760
fix new gitlab
robertomonteromiguel Feb 7, 2025
7d74577
orchestrators
robertomonteromiguel Feb 10, 2025
f7101e8
Java is done
robertomonteromiguel Feb 10, 2025
bb4edef
all scenarios ready
robertomonteromiguel Feb 11, 2025
45944c4
Revamp data extractor/exporter
cbeauchesne Feb 11, 2025
897ca43
Add few weblogs
cbeauchesne Feb 11, 2025
ef42e82
wizard update
robertomonteromiguel Feb 11, 2025
d5ea73b
better log exception
robertomonteromiguel Feb 11, 2025
2938cf0
merge main
robertomonteromiguel Feb 11, 2025
b8496fc
fix conflicts
robertomonteromiguel Feb 11, 2025
ba29354
fix multicontainer apps and fix the test_the_test
robertomonteromiguel Feb 11, 2025
ba5a28d
fix ruby multicontainer
robertomonteromiguel Feb 11, 2025
8bad0a9
remove unused entries from virtual machine json file
robertomonteromiguel Feb 11, 2025
8e81b11
merge main
robertomonteromiguel Feb 11, 2025
86020f4
conflicts
robertomonteromiguel Feb 11, 2025
c06ab22
deleted vms
robertomonteromiguel Feb 11, 2025
e8382cb
add windows
robertomonteromiguel Feb 11, 2025
17f4d3c
fix decorator
robertomonteromiguel Feb 11, 2025
075e54c
small fixes
robertomonteromiguel Feb 12, 2025
6776b2e
add bug annotation
robertomonteromiguel Feb 12, 2025
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
10 changes: 10 additions & 0 deletions .gitlab/aws_gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
stages:
- SCENARIOS

.base_job_aws:
image: registry.ddbuild.io/images/ci_docker_base
tags: ["arch:amd64"]
script:
- echo "WEBLOG: $WEBLOG"
- echo "SCENARIO: $SCENARIO"
- echo "VIRTUAL_MACHINE: $VIRTUAL_MACHINE"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the command to run the onboarding tests: ./run.sh AUTO_INJECTION....

2 changes: 0 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ def pytest_addoption(parser) -> None:
parser.addoption("--vm-library", type=str, action="store", help="Set virtual machine library to test")
parser.addoption("--vm-env", type=str, action="store", help="Set virtual machine environment")
parser.addoption("--vm-provider", type=str, action="store", help="Set provider for VMs")
parser.addoption("--vm-only-branch", type=str, action="store", help="Filter to execute only one vm branch")
parser.addoption("--vm-only", type=str, action="store", help="Filter to execute only one vm name")
parser.addoption("--vm-skip-branches", type=str, action="store", help="Filter exclude vm branches")
parser.addoption(
"--vm-gitlab-pipeline",
type=str,
Expand Down
5 changes: 0 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ function main() {
if [[ "${scenario}" == K8S_LIBRARY_INJECTION_* ]]; then
pytest_numprocesses=$(nproc)
fi
if [[ "${scenario}" == *_AUTO_INJECTION ]]; then
pytest_numprocesses=6
#https://pytest-xdist.readthedocs.io/en/latest/distribution.html
pytest_args+=( '--dist' 'loadgroup' )
fi
done

case "${pytest_numprocesses}" in
Expand Down
67 changes: 40 additions & 27 deletions tests/auto_inject/test_auto_inject_chaos.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import requests
from utils import scenarios, features, context
from utils import scenarios, features, context, bug, irrelevant, missing_feature
from utils.tools import logger
from utils.onboarding.weblog_interface import warmup_weblog
from utils.onboarding.wait_for_tcp_port import wait_for_port
import tests.auto_inject.utils as base
from utils.virtual_machine.utils import parametrize_virtual_machines


class BaseAutoInjectChaos(base.AutoInjectBaseTest):
Expand All @@ -30,7 +29,7 @@ def _test_removing_things(self, virtual_machine, evil_command):
self.execute_command(virtual_machine, evil_command)
logger.info(f"[{virtual_machine.name}]Ok evil command launched!")
# Assert the app is still working
wait_for_port(vm_port, vm_ip, 40.0)
assert wait_for_port(vm_port, vm_ip, 40.0), "Weblog port not reachable. Is the weblog running?"
r = requests.get(weblog_url, timeout=10)
assert r.status_code == 200, "The weblog app it's not working after remove the installation folder"
logger.info(f"[{virtual_machine.name}]Ok the weblog app it's working after remove wrong things")
Expand All @@ -43,7 +42,7 @@ def _test_removing_things(self, virtual_machine, evil_command):
# Start the app again
self.execute_command(virtual_machine, weblog_start_command)
# App shpuld be working again, although the installation folder was removed
wait_for_port(vm_port, vm_ip, 40.0)
assert wait_for_port(vm_port, vm_ip, 40.0), "Weblog port not reachable. Is the weblog running?"
warmup_weblog(weblog_url)
r = requests.get(weblog_url, timeout=10)
assert (
Expand Down Expand Up @@ -87,36 +86,50 @@ def _test_removing_things(self, virtual_machine, evil_command):
@features.installer_auto_instrumentation
@scenarios.chaos_installer_auto_injection
class TestAutoInjectChaos(BaseAutoInjectChaos):
@parametrize_virtual_machines(
bugs=[
{"vm_branch": "amazon_linux2", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
{"vm_branch": "centos_7_amd64", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
{"vm_branch": "redhat", "vm_cpu": "arm64", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
# Windows is not supported. Change to missing_feature after merge
{"vm_branch": "windows", "reason": "APMON-9999"},
{"vm_name": "Ubuntu_24_10_amd64", "weblog_variant": "test-app-python", "reason": "INPLAT-478"},
{"vm_name": "Ubuntu_24_10_arm64", "weblog_variant": "test-app-python", "reason": "INPLAT-478"},
]
@bug(
context.vm_os_branch in ["amazon_linux2", "centos_7_amd64"] and context.weblog_variant == "test-app-ruby",
reason="INPLAT-103",
)
def test_install_after_ld_preload(self, virtual_machine):
@bug(
context.vm_os_branch == "redhat" and context.vm_os_cpu == "arm64" and context.weblog_variant == "test-app-ruby",
reason="INPLAT-103",
)
@irrelevant(
context.vm_name in ["Amazon_Linux_2023_amd64", "Amazon_Linux_2023_arm64"],
reason="LD library failures impact on the docker engine, causes flakiness",
)
@bug(
context.vm_name in ["Ubuntu_24_10_amd64", "Ubuntu_24_10_arm64"] and context.weblog_variant == "test-app-python",
reason="INPLAT-478",
)
@missing_feature(context.vm_os_branch == "windows", reason="Not implemented on Windows")
def test_install_after_ld_preload(self):
"""We added entries to the ld.so.preload. After that, we can install the dd software and the app should be instrumented."""
virtual_machine = context.scenario.virtual_machine
logger.info(f"Launching test_install for : [{virtual_machine.name}]...")
self._test_install(virtual_machine)
logger.info(f"Done test_install for : [{virtual_machine.name}]")

@parametrize_virtual_machines(
bugs=[
{"vm_name": "AlmaLinux_8_arm64", "weblog_variant": "test-app-python-alpine", "reason": "APMON-1576"},
{"vm_branch": "amazon_linux2", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
{"vm_branch": "centos_7_amd64", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
{"vm_branch": "redhat", "vm_cpu": "arm64", "weblog_variant": "test-app-ruby", "reason": "INPLAT-103"},
# Windows is not supported. Change to missing_feature after merge
{"vm_branch": "windows", "reason": "APMON-9999"},
{"vm_name": "Ubuntu_24_10_amd64", "weblog_variant": "test-app-python", "reason": "INPLAT-478"},
{"vm_name": "Ubuntu_24_10_arm64", "weblog_variant": "test-app-python", "reason": "INPLAT-478"},
]
@bug(
context.vm_name == "AlmaLinux_8_arm64" and context.weblog_variant == "test-app-python-alpine",
reason="APMON-1576",
)
@bug(
context.vm_os_branch == ["centos_7_amd64", "amazon_linux2"] and context.weblog_variant == "test-app-ruby",
reason="INPLAT-103",
)
@bug(
context.vm_os_branch == "redhat" and context.vm_os_cpu == "arm64" and context.weblog_variant == "test-app-ruby",
reason="INPLAT-103",
)
@bug(
context.vm_name in ["Ubuntu_24_10_amd64", "Ubuntu_24_10_arm64"] and context.weblog_variant == "test-app-python",
reason="INPLAT-478",
)
def test_remove_ld_preload(self, virtual_machine):
@missing_feature(context.vm_os_branch == "windows", reason="Not implemented on Windows")
def test_remove_ld_preload(self):
"""We added entries to the ld.so.preload. After that, we can remove the entries and the app should be instrumented."""
virtual_machine = context.scenario.virtual_machine
logger.info(f"Launching test_remove_ld_preload for : [{virtual_machine.name}]...")
self._test_removing_things(virtual_machine, "sudo rm /etc/ld.so.preload")
logger.info(f"Success test_remove_ld_preload for : [{virtual_machine.name}]")
9 changes: 4 additions & 5 deletions tests/auto_inject/test_auto_inject_guardrail.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
from utils import scenarios, features
from utils import scenarios, features, context
from utils.tools import logger
from utils.onboarding.weblog_interface import make_get_request, warmup_weblog
from utils.onboarding.wait_for_tcp_port import wait_for_port
from utils.virtual_machine.utils import parametrize_virtual_machines


@features.host_guardrail
@scenarios.installer_not_supported_auto_injection
class TestLanguageVersionNotSupported:
"""Test for not supported auto injection. We only check the app is working, although the auto injection is not performed."""

@parametrize_virtual_machines()
def test_app_working(self, virtual_machine):
def test_app_working(self):
"""Test app is working."""
virtual_machine = context.scenario.virtual_machine
vm_ip = virtual_machine.get_ip()
vm_port = virtual_machine.deffault_open_port
vm_name = virtual_machine.name
logger.info(f"[{vm_name}] Waiting for weblog available [{vm_ip}:{vm_port}]")
wait_for_port(vm_port, vm_ip, 80.0)
assert wait_for_port(vm_port, vm_ip, 80.0), "Weblog port not reachable. Is the weblog running?"
logger.info(f"[{vm_ip}]: Weblog app is ready!")
warmup_weblog(f"http://{vm_ip}:{vm_port}/")
logger.info(f"Making a request to weblog [{vm_ip}:{vm_port}]")
Expand Down
Loading
Loading