Skip to content

Commit

Permalink
Use logging directly after conftest initialisation
Browse files Browse the repository at this point in the history
Signed-off-by: noopur <[email protected]>
  • Loading branch information
noopurintel committed Nov 12, 2024
1 parent c76aa84 commit 4e0f265
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/task_runner_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
name: Task Runner E2E

on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch:
Expand Down
4 changes: 3 additions & 1 deletion tests/end_to_end/models/participants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import os
from datetime import datetime
import yaml
import logging

import tests.end_to_end.utils.constants as constants
from tests.end_to_end.utils.logger import logger as log
import tests.end_to_end.utils.subprocess_helper as sh

log = logging.getLogger(__name__)


# Define the ModelOwner class
class ModelOwner:
Expand Down
3 changes: 2 additions & 1 deletion tests/end_to_end/test_suites/sample_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
import logging

from tests.end_to_end.utils.logger import logger as log
from tests.end_to_end.utils import federation_helper as fed_helper

log = logging.getLogger(__name__)

# ** IMPORTANT **: This is just an example on how to add a test with below pre-requisites.
# Task Runner API Test function for federation run using sample_model
Expand Down
4 changes: 3 additions & 1 deletion tests/end_to_end/test_suites/task_runner_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
import logging

from tests.end_to_end.utils.logger import logger as log
from tests.end_to_end.utils import federation_helper as fed_helper

log = logging.getLogger(__name__)


@pytest.mark.torch_cnn_mnist
def test_torch_cnn_mnist(fx_federation):
Expand Down
3 changes: 2 additions & 1 deletion tests/end_to_end/utils/conftest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

import argparse
import sys
import logging

from tests.end_to_end.utils.logger import logger as log
log = logging.getLogger(__name__)


def parse_arguments():
Expand Down
4 changes: 3 additions & 1 deletion tests/end_to_end/utils/federation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

import time
import concurrent.futures
import logging

from tests.end_to_end.utils.constants import SUCCESS_MARKER
from tests.end_to_end.utils.logger import logger as log

log = logging.getLogger(__name__)


def setup_pki(fed_obj):
Expand Down
3 changes: 2 additions & 1 deletion tests/end_to_end/utils/subprocess_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import subprocess
import time
import traceback
import logging

from tests.end_to_end.utils.logger import logger as log
log = logging.getLogger(__name__)


def run_command_background(
Expand Down
3 changes: 0 additions & 3 deletions tests/end_to_end/utils/xml_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from lxml import etree
import os

from tests.end_to_end.utils.logger import logger as log

# Initialize the XML parser
parser = etree.XMLParser(recover=True, encoding='utf-8')
tree = ET.parse("results/results.xml", parser=parser)
Expand Down Expand Up @@ -63,7 +61,6 @@ def get_testcase_result():
database_list.append(database_dict)
status = None

log.info(f"Database list = {database_list}")
return database_list


Expand Down

0 comments on commit 4e0f265

Please sign in to comment.