Skip to content

Commit

Permalink
test: skip test_language_package in long tests (intel#4327)
Browse files Browse the repository at this point in the history
* test: `test_language_package` is not skipped if LONG_TEST is disabled.[Issue intel#4322]

* Fixed the liniting error.

* changes to triage file

* Updated the mark to handle all input params.

---------

Co-authored-by: Terri Oda <[email protected]>
  • Loading branch information
muddi900 and terriko authored Aug 15, 2024
1 parent 43fc9e9 commit bceb2c0
Show file tree
Hide file tree
Showing 2 changed files with 509 additions and 31 deletions.
94 changes: 77 additions & 17 deletions test/test_language_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

from pathlib import Path
from test.utils import LONG_TESTS

import pytest

Expand Down Expand Up @@ -221,66 +222,125 @@ def test_language_package_none_found(self, filename: str) -> None:
@pytest.mark.parametrize(
"filename,parser_class,products,namespace",
[
(str(TEST_FILE_PATH / "renv.lock"), parsers.r.RParser, R_PRODUCTS, "cran"),
(
pytest.param(
str(TEST_FILE_PATH / "renv.lock"),
parsers.r.RParser,
R_PRODUCTS,
"cran",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
pytest.param(
str(TEST_FILE_PATH / "Cargo.lock"),
parsers.rust.RustParser,
RUST_PRODUCTS,
"cargo",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "Gemfile.lock"),
parsers.ruby.RubyParser,
RUBY_PRODUCTS,
"gem",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "requirements.txt"),
parsers.python.PythonRequirementsParser,
parsers.python.PythonParser,
PYTHON_PRODUCTS,
"pypi",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "package-lock.json"),
parsers.javascript.JavascriptParser,
JAVASCRIPT_PRODUCTS,
"npm",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
str(TEST_FILE_PATH / ".package-lock.json"),
parsers.javascript.JavascriptParser,
JAVASCRIPT_PRODUCTS,
"npm",
),
(
pytest.param(
str(TEST_FILE_PATH / "go.mod"),
parsers.go.GoParser,
GO_PRODUCTS,
"golang",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "Package.resolved"),
parsers.swift.SwiftParser,
SWIFT_PRODUCTS,
"swift",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "composer.lock"),
parsers.php.PhpParser,
PHP_PRODUCTS,
"composer",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "cpanfile"),
parsers.perl.PerlParser,
PERL_PRODUCTS,
"cpan",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
(
pytest.param(
str(TEST_FILE_PATH / "pubspec.lock"),
parsers.dart.DartParser,
DART_PRODUCTS,
"pub",
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
),
],
)
Expand Down
Loading

0 comments on commit bceb2c0

Please sign in to comment.