chore: fix test cases

This commit is contained in:
salman2013
2023-09-27 16:57:53 +05:00
parent caeb8d9694
commit 3abf597152
3 changed files with 3 additions and 92 deletions

View File

@@ -30,14 +30,6 @@ jobs:
- name: Setup npm
run: npm i -g npm@8.5.x
# - name: Install Firefox 61.0
# run: |
# sudo apt-get purge firefox
# wget "https://ftp.mozilla.org/pub/firefox/releases/61.0/linux-x86_64/en-US/firefox-61.0.tar.bz2"
# tar -xjf firefox-61.0.tar.bz2
# sudo mv firefox /opt/firefox
# sudo ln -s /opt/firefox/firefox /usr/bin/firefox
- name: Install Required System Packages
run: sudo apt-get update && sudo apt-get install libxmlsec1-dev ubuntu-restricted-extras xvfb

View File

@@ -3,9 +3,6 @@ A pytest plugin that reports test contexts to coverage running in another proces
"""
import pytest
# import requests
# from pavelib.utils.envs import Env
class RemoteContextPlugin:
@@ -25,19 +22,7 @@ class RemoteContextPlugin:
def pytest_runtest_call(self, item):
self.doit(item, "call")
# commented for testing
# def doit(self, item, when): # lint-amnesty, pylint: disable=missing-function-docstring
# if self.active:
# for cfg in Env.BOK_CHOY_SERVERS.values():
# result = requests.post(
# 'http://{host}:{port}/coverage_context/update_context'.format(**cfg),
# {
# 'context': f"{item.nodeid}|{when}",
# }
# )
# assert result.status_code == 204
@pytest.hookimpl(tryfirst=True)
def pytest_configure(config):
config.pluginmanager.register(RemoteContextPlugin(config), "remotecontextplugin")

View File

@@ -55,15 +55,6 @@ class TestPaverJavaScriptTestTasks(PaverTestCase):
["--suite=lms"],
["--suite=lms --coverage"],
)
# @ddt.unpack
# def test_test_js_run(self, options_string):
# """
# Test the "test_js_run" task.
# """
# options = self.parse_options_string(options_string)
# self.reset_task_messages()
# call_task("pavelib.js_test.test_js_run", options=options)
# self.verify_messages(options=options, dev_mode=False)
@ddt.data(
[""],
@@ -71,16 +62,7 @@ class TestPaverJavaScriptTestTasks(PaverTestCase):
["--suite=lms"],
["--suite=lms --port=9999"],
)
# @ddt.unpack
# def test_test_js_dev(self, options_string):
# """
# Test the "test_js_run" task.
# """
# options = self.parse_options_string(options_string)
# self.reset_task_messages()
# call_task("pavelib.js_test.test_js_dev", options=options)
# self.verify_messages(options=options, dev_mode=True)
def parse_options_string(self, options_string):
"""
Parse a string containing the options for a test run
@@ -99,52 +81,4 @@ class TestPaverJavaScriptTestTasks(PaverTestCase):
"suite": suite,
"coverage": coverage,
"port": port,
}
# def verify_messages(self, options, dev_mode):
# """
# Verify that the messages generated when running tests are as expected
# for the specified options and dev_mode.
# """
# is_coverage = options['coverage']
# port = options['port']
# expected_messages = []
# suites = Env.JS_TEST_ID_KEYS if options['suite'] == 'all' else [options['suite']]
# expected_messages.extend(self.EXPECTED_COMMANDS)
# if not dev_mode and not is_coverage:
# expected_messages.append(self.EXPECTED_DELETE_JAVASCRIPT_REPORT_COMMAND.format(
# platform_root=self.platform_root
# ))
# expected_messages.append(self.EXPECTED_INSTALL_NPM_ASSETS_COMMAND)
# command_template = (
# 'node --max_old_space_size=4096 node_modules/.bin/karma start {options}'
# )
# for suite in suites:
# # Karma test command
# if suite != 'jest-snapshot':
# karma_config_file = Env.KARMA_CONFIG_FILES[Env.JS_TEST_ID_KEYS.index(suite)]
# expected_test_tool_command = command_template.format(
# options=self.EXPECTED_KARMA_OPTIONS.format(
# config_file=karma_config_file,
# single_run='false' if dev_mode else 'true',
# suite=suite,
# platform_root=self.platform_root,
# browser=Env.KARMA_BROWSER,
# ),
# )
# if is_coverage:
# expected_test_tool_command += self.EXPECTED_COVERAGE_OPTIONS.format(
# platform_root=self.platform_root,
# suite=suite
# )
# if port:
# expected_test_tool_command += f" --port={port}"
# else:
# expected_test_tool_command = 'jest'
# expected_messages.append(expected_test_tool_command)
# assert self.task_messages == expected_messages
}