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

Fix pytests and update build.sh to add ppc64le support. #4413

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

Sunidhi-Gaonkar1
Copy link
Contributor

@Sunidhi-Gaonkar1 Sunidhi-Gaonkar1 commented Feb 6, 2024

Description

Adding ppc64le build target to build.sh

Issues Resolved

Fixes the pytest errors faced in #4348
Part of #3122

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@peterzhuamazon
Copy link
Member

@Sunidhi-Gaonkar1 do you want to also upgrade pyyaml to 6.0.1 in the same PR?

Thanks.

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fec0355) 91.35% compared to head (69729cf) 91.55%.
Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4413      +/-   ##
==========================================
+ Coverage   91.35%   91.55%   +0.20%     
==========================================
  Files         190      190              
  Lines        6175     6216      +41     
==========================================
+ Hits         5641     5691      +50     
+ Misses        534      525       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -14,7 +14,7 @@
class TestOs(unittest.TestCase):
# current_architecture
def test_current_architecture(self) -> None:
self.assertTrue(current_architecture() in ["x64", "arm64"])
self.assertTrue(current_architecture() in ["x64", "arm64", "ppc64le"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sunidhi-Gaonkar1 you need to add one more test case:



src/system/os.py#L19

Added line #L19 was not covered by tests


Copy link
Contributor Author

@Sunidhi-Gaonkar1 Sunidhi-Gaonkar1 Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterzhuamazon ,I have made the changes, Please review. Thank you.

Signed-off-by: Sunidhi-Gaonkar1 <sunidhi.gaonkar@ibm.com>
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 7, 2024

Hi @Sunidhi-Gaonkar1 ,

  1. I recently realize isort in macos version is giving different result compares to in linux, so I update your isort result and revert all the yaml import changes.
  2. The Pipfile.lock is not updated, and even after I update it I still see issues:
% pipenv install
Pipfile.lock (fcf5b2) out of date, updating to (32b10d)...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (c03613ba05c90c679f5832c9f4275d5523890031d2141f6bd2e6916d1a32b10d)!
Installing dependencies from Pipfile.lock (32b10d)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
(python39)

% pipenv run pytest
.................................................................................................................................................................................................................................................................................................................... [ 37%]
.................................................................................................................................................................................................................................................................................................................... [ 74%]
.....................................................................................................................................................................................F...............................                                                                                                [100%]
========================================================================================================================================================= FAILURES =========================================================================================================================================================
____________________________________________________________________________________________________________________________________________ TestValidationRpm.test_exceptions _____________________________________________________________________________________________________________________________________________

self = <tests.tests_validation_workflow.test_validation_rpm.TestValidationRpm testMethod=test_exceptions>, mock_validation_args = <MagicMock name='ValidationArgs' id='139868198733136'>

    @patch('validation_workflow.rpm.validation_rpm.ValidationArgs')
    def test_exceptions(self, mock_validation_args: Mock) -> None:
        with self.assertRaises(Exception) as e1:
            mock_validation_args.return_value.projects = ["opensearch"]
            mock_validation_args.return_value.file_path = {"opensearch": "/src/files/opensearch.rpm"}
            validate_rpm = ValidateRpm(mock_validation_args.return_value)
>           validate_rpm.installation()
E           AssertionError: Exception not raised

/temp111/opensearch-build/tests/tests_validation_workflow/test_validation_rpm.py:72: AssertionError
===================================================================================================================================================== warnings summary =====================================================================================================================================================
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_multi_node
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_multi_node
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_multi_node_without_manifest
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_single_node_insecure
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_single_node_secure
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_endpoint
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_port
  /temp111/opensearch-build/tests/../src/test_workflow/benchmark_test/benchmark_test_cluster.py:146: PendingDeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 3.0.0.  Still under investigation, see #258. Use the respective 'semver.Version.compare' instead.
    if not self.args.insecure and semver.compare(self.manifest.build.version, '2.12.0') != -1:

tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster.py::TestBenchmarkTestCluster::test_create_multi_node_without_manifest
  /temp111/opensearch-build/tests/../src/test_workflow/benchmark_test/benchmark_test_cluster.py:150: PendingDeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 3.0.0.  Still under investigation, see #258. Use the respective 'semver.Version.compare' instead.
    if not self.args.insecure and semver.compare(self.args.distribution_version, '2.12.0') != -1:

tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py::TestBenchmarkTestSuite::test_execute_security_enabled
tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py::TestBenchmarkTestSuite::test_execute_security_enabled_version_212_or_greater
  /temp111/opensearch-build/tests/../src/test_workflow/benchmark_test/benchmark_test_suite.py:75: PendingDeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 3.0.0.  Still under investigation, see #258. Use the respective 'semver.Version.compare' instead.
    if semver.compare(self.distribution_version, '2.12.0') != -1:

tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch.py::ServiceOpenSearchTests::test_get_service_response
tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch_dashboards.py::ServiceOpenSearchDashboardsTests::test_get_service_response_with_security
tests/tests_test_workflow/test_integ_workflow/integ_test/test_utils.py::TestUtils::test_strong_password
tests/tests_test_workflow/test_integ_workflow/integ_test/test_utils.py::TestUtils::test_strong_password
  /temp111/opensearch-build/tests/../src/test_workflow/integ_test/utils.py:13: PendingDeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 3.0.0.  Still under investigation, see #258. Use the respective 'semver.Version.compare' instead.
    if semver.compare(version, '2.12.0') != -1:

tests/tests_test_workflow/test_perf_workflow/perf_test/test_perf_test_cluster.py::TestPerfTestCluster::test_get_service_response
  /temp111/opensearch-build/tests/../src/test_workflow/perf_test/perf_test_cluster.py:114: PendingDeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 3.0.0.  Still under investigation, see #258. Use the respective 'semver.Version.compare' instead.
    if semver.compare(self.manifest.build.version, '2.12.0') != -1:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================================================================================= short test summary info ==================================================================================================================================================
FAILED tests/tests_validation_workflow/test_validation_rpm.py::TestValidationRpm::test_exceptions - AssertionError: Exception not raised
1 failed, 828 passed, 15 warnings in 59.52s

@Sunidhi-Gaonkar1
Copy link
Contributor Author

Hi @peterzhuamazon, We don't have a macos server to reproduce this issue. Please let me know how we can
move further on this.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 8, 2024

Hi @peterzhuamazon, We don't have a macos server to reproduce this issue. Please let me know how we can move further on this.

@Sunidhi-Gaonkar1 this is not macos issue you can just run pipenv intall with your latest pipfile changes, build the new pipfile.lock, and run pipenv run pytest to see the above issue.

I was running on linux to see this issue.

I was saying do not run isort on macos run it on linux. isort is not the same as pytest.

@Sunidhi-Gaonkar1
Copy link
Contributor Author

@peterzhuamazon, I have followed your instructions to build the Pipfile.lock with latest changes and run pytests on linux
x86,I am unable to reproduce the above issue and the tests are passing for me locally.I have attached the complete logs below including the steps I have followed. Please let me know if I am missing something.

apt install git wget python3.9 curl python3-pip vim
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
export PYENV_ROOT="$HOME/.pyenv"
git clone https://github.com/opensearch-project/opensearch-build
cd opensearch-build
pip install pipenv
pipenv install
pipenv run pytest

Pytest_logs.txt

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 12, 2024

@peterzhuamazon, I have followed your instructions to build the Pipfile.lock with latest changes and run pytests on linux x86,I am unable to reproduce the above issue and the tests are passing for me locally.I have attached the complete logs below including the steps I have followed. Please let me know if I am missing something.

apt install git wget python3.9 curl python3-pip vim
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
export PYENV_ROOT="$HOME/.pyenv"
git clone https://github.com/opensearch-project/opensearch-build
cd opensearch-build
pip install pipenv
pipenv install
pipenv run pytest

Pytest_logs.txt

Taking a look, I am not able to pass on both my mac and my AL2 server 😅
The one succeeded is our build centos7 images, will try to reproduce on that or just copy the pipefile.lock and try other places.

Thanks.

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
@peterzhuamazon
Copy link
Member

Seems like my push of the new pipefile.lock runs well.
@Sunidhi-Gaonkar1 I will hold on the merge of this until 2.12 is out as we are still in the release process now.
Thanks!

@peterzhuamazon peterzhuamazon merged commit 4553a95 into opensearch-project:main Feb 22, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants