From 6abd8e40bf05d2470f55e9ad89537e1621f2e8a6 Mon Sep 17 00:00:00 2001 From: Alejandro Brugarolas Date: Fri, 2 Aug 2024 16:18:26 +0200 Subject: [PATCH 1/2] add hello-world dotnet analysis test Signed-off-by: Alejandro Brugarolas --- data/applications/dotnet-hello-world.zip | Bin 0 -> 5011 bytes data/dotnet_analysis.json | 6 ++++ data/yaml/dotnet/example_rules/example.yaml | 14 +++++++++ data/yaml/dotnet/example_rules/ruleset.yaml | 3 ++ fixtures/analysis.py | 7 +++++ tests/analysis/__init__.py | 0 tests/analysis/dotnet/__init__.py | 0 tests/analysis/dotnet/test_dotnet_analysis.py | 29 ++++++++++++++++++ tests/analysis/java/__init__.py | 0 .../java/test_java_analysis.py} | 0 utils/common.py | 26 ++++++++++++++++ 11 files changed, 85 insertions(+) create mode 100644 data/applications/dotnet-hello-world.zip create mode 100644 data/dotnet_analysis.json create mode 100644 data/yaml/dotnet/example_rules/example.yaml create mode 100644 data/yaml/dotnet/example_rules/ruleset.yaml create mode 100644 tests/analysis/__init__.py create mode 100644 tests/analysis/dotnet/__init__.py create mode 100644 tests/analysis/dotnet/test_dotnet_analysis.py create mode 100644 tests/analysis/java/__init__.py rename tests/{test_analysis.py => analysis/java/test_java_analysis.py} (100%) create mode 100644 utils/common.py diff --git a/data/applications/dotnet-hello-world.zip b/data/applications/dotnet-hello-world.zip new file mode 100644 index 0000000000000000000000000000000000000000..5fd221c639ee898bacffca485780d3f7d7616a63 GIT binary patch literal 5011 zcmcJS3pmvI8pr>W%eeM93|VE0#UV3tHi>pwlf^PFqufh1%*D9OFf+)l21|CecvNn& zO*L*E*RX6vZh2f%x)BN|xpbOT>$cJ9{QsO`wr0*VC!N=09{3UQ_s*zx$GPFWeX76oG~2vUmXm@haqlj3N21>y zO)YFsj84{WPB}f6n^(-K!@>ZZ+AQ*`j+)kq-D-PdYBF1<6w6BVO)72;NTB5M5xs|t zj~g3M-ws}#3)Jn*+g#nB;bK&QXO&+%ZnpHb9%)Q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l91!HK1bsLHos{%26;EdbtW z_-P2DRbFsn{Ut^7fd4d~i(NlFB|m*YWX20ltd^8$r~JH}_Tl;Xkpf~MUT|W)q(wU) tpNpSLL?0fC|E&qp3@ Date: Fri, 2 Aug 2024 16:27:23 +0200 Subject: [PATCH 2/2] fix pr Signed-off-by: Alejandro Brugarolas --- tests/analysis/dotnet/test_dotnet_analysis.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/analysis/dotnet/test_dotnet_analysis.py b/tests/analysis/dotnet/test_dotnet_analysis.py index 1d713fb..4cf3055 100644 --- a/tests/analysis/dotnet/test_dotnet_analysis.py +++ b/tests/analysis/dotnet/test_dotnet_analysis.py @@ -5,8 +5,13 @@ from utils.command import build_analysis_command from utils.common import extract_zip_to_temp_dir + # Polarion TC MTA-568 def test_hello_world_analysis_with_rules(dotnet_analysis_data): + # Avoid running this test on Windows + if os.name == 'nt': + return + application_data = dotnet_analysis_data["hello_world"] application_path = os.path.join( os.getenv(constants.PROJECT_PATH), @@ -16,7 +21,6 @@ def test_hello_world_analysis_with_rules(dotnet_analysis_data): custom_rules_path = os.path.join(os.getenv(constants.PROJECT_PATH), 'data/yaml/dotnet/example_rules') with extract_zip_to_temp_dir(application_path) as tempdir: - command = build_analysis_command( tempdir, "",