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

Reorganize directory structure of end-to-end tests #2708

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docker run --rm \
--env AZURE_CLIENT_SECRET \
--env AZURE_TENANT_ID \
waagenttests.azurecr.io/waagenttests \
bash --login -c '$HOME/WALinuxAgent/tests_e2e/scripts/execute_tests.sh'
bash --login -c '$HOME/WALinuxAgent/tests_e2e/scenarios/scripts/run_scenarios.sh'

# Retake ownership of the staging directory
sudo find "$BUILD_ARTIFACTSTAGINGDIRECTORY" -exec chown "$USER" {} \;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
addToPath: true
architecture: 'x64'

- bash: $(Build.SourcesDirectory)/tests_e2e/scripts/execute_tests_container.sh
- bash: $(Build.SourcesDirectory)/tests_e2e/pipeline/scripts/execute_tests.sh
displayName: "Execute tests"
env:
# Add all KeyVault secrets explicitly as they're not added by default to the environment vars
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from azure.core.polling import LROPoller

from tests_e2e.scenario_utils.azure_models import ComputeManager
from tests_e2e.scenario_utils.logging_utils import LoggingHandler
from tests_e2e.scenario_utils.models import ExtensionMetaData, get_vm_data_from_env
from tests_e2e.scenarios.modules.azure_models import ComputeManager
from tests_e2e.scenarios.modules.logging_utils import LoggingHandler
from tests_e2e.scenarios.modules.models import ExtensionMetaData, get_vm_data_from_env


class BaseExtensionTestClass(LoggingHandler):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import uuid

from tests_e2e.scenario_utils.extensions.BaseExtensionTestClass import BaseExtensionTestClass
from tests_e2e.scenario_utils.models import ExtensionMetaData
from tests_e2e.scenarios.modules.BaseExtensionTestClass import BaseExtensionTestClass
from tests_e2e.scenarios.modules.models import ExtensionMetaData


class CustomScriptExtension(BaseExtensionTestClass):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from azure.mgmt.resource import ResourceManagementClient
from msrestazure.azure_exceptions import CloudError

from tests_e2e.scenario_utils.logging_utils import LoggingHandler
from tests_e2e.scenario_utils.models import get_vm_data_from_env, VMModelType, VMMetaData
from tests_e2e.scenarios.modules.logging_utils import LoggingHandler
from tests_e2e.scenarios.modules.models import get_vm_data_from_env, VMModelType, VMMetaData


class AzureComputeBaseClass(ABC, LoggingHandler):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
cd "$HOME/lisa"

./lisa.sh \
--runbook "$HOME/WALinuxAgent/tests_e2e/lisa/runbook/azure.yml" \
--runbook "$HOME/WALinuxAgent/tests_e2e/scenarios/runbooks/daily.yml" \
--log_path "$HOME/logs" \
--working_path "$HOME/logs" \
-v subscription_id:"$SUBSCRIPTION_ID" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import uuid
import sys

from tests_e2e.scenario_utils.extensions.CustomScriptExtension import CustomScriptExtension
from tests_e2e.scenarios.modules.CustomScriptExtension import CustomScriptExtension


def main(subscription_id, resource_group_name, vm_name):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from assertpy import assert_that

from tests_e2e.lisa.testsuites.agent_test_suite import AgentTestSuite
from tests_e2e.lisa.tests.agent_bvt import custom_script
from tests_e2e.scenarios.testsuites.agent_test_suite import AgentTestSuite
from tests_e2e.scenarios.tests.bvts import custom_script

from lisa import (
simple_requirement,
Expand All @@ -25,7 +25,7 @@ def main(self, *_, **__) -> None:
self.custom_script()

def check_agent_version(self) -> None:
exit_code = self._execute_remote_script(self._test_root.joinpath("lisa", "tests", "agent_bvt"), "check_agent_version.py")
exit_code = self._execute_remote_script(self._test_root.joinpath("scenarios", "tests"), "check_agent_version.py")
assert_that(exit_code).is_equal_to(0)

def custom_script(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def before_case(self, *_, **kwargs) -> None:
def after_case(self, *_, **__) -> None:
# Collect the logs on the test machine into a compressed tarball
self._log.info("Collecting logs on test machine [%s]...", self._node.name)
self._execute_remote_script(self._test_root.joinpath("scripts"), "collect_logs.sh")
self._execute_remote_script(self._test_root.joinpath("scenarios", "scripts"), "collect_logs.sh")

# Copy the tarball to the local logs directory
remote_path = PurePath('/home') / self._node.connection_info['username'] / 'logs.tgz'
Expand Down