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: Fix CI for artifactory tests colliding in parallel run #151

Merged
merged 13 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test_conan_extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U pip
pip install pytest "cyclonedx-python-lib>=5.0.0,<6"
pip install pytest pytest-order "cyclonedx-python-lib>=5.0.0,<6"
- name: Install Conan latest
run: |
pip install conan
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Install dependencies and Conan latest
run: |
pip install -U pip
pip install pytest conan
pip install pytest pytest-order conan
- name: Run Windows-specific tests - Conan latest / Python 3.8
run: |
pytest -v -m win32 tests
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
markers =
requires_credentials: mark tests that require credentials for Artifactory
win32: mark tests that should be run only on a Windows machine
12 changes: 12 additions & 0 deletions tests/test_artifactory_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def conan_test():


@pytest.mark.requires_credentials
@pytest.mark.order(1)
def test_build_info_create_no_deps():

build_name = "mybuildinfo"
Expand Down Expand Up @@ -121,6 +122,7 @@ def test_build_info_create_no_deps():


@pytest.mark.requires_credentials
@pytest.mark.order(2)
def test_build_info_create_with_build_url():

build_name = "mybuildinfo"
Expand All @@ -141,6 +143,7 @@ def test_build_info_create_with_build_url():


@pytest.mark.requires_credentials
@pytest.mark.order(3)
def test_build_info_create_deps():
# +-------+
# | libc |
Expand Down Expand Up @@ -233,6 +236,7 @@ def test_build_info_create_deps():


@pytest.mark.requires_credentials
@pytest.mark.order(4)
def test_build_info_create_from_cached_deps():
# Make sure artifactory repos are empty before starting the test
run("conan remove mypkg* -c -r extensions-stg")
Expand Down Expand Up @@ -267,6 +271,7 @@ def test_build_info_create_from_cached_deps():


@pytest.mark.requires_credentials
@pytest.mark.order(5)
def test_fail_if_not_uploaded():
"""
In order to create the Build Info we need the hashes of the artifacts that are uploaded
Expand All @@ -287,6 +292,7 @@ def test_fail_if_not_uploaded():


@pytest.mark.requires_credentials
@pytest.mark.order(5)
def test_build_info_project():
"""
Test that build info is correctly manages using a project in Artifactory
Expand Down Expand Up @@ -329,6 +335,7 @@ def test_build_info_project():


@pytest.mark.requires_credentials
@pytest.mark.order(7)
def test_build_info_dependency_different_repo():
"""
Test that build info is correctly generated for a package with dependencies in a different repo in Artifactory
Expand Down Expand Up @@ -382,6 +389,7 @@ def test_build_info_dependency_different_repo():


@pytest.mark.requires_credentials
@pytest.mark.order(8)
def test_server_complete():
"""
Test server add, list, remove commands
Expand Down Expand Up @@ -411,6 +419,7 @@ def test_server_complete():


@pytest.mark.requires_credentials
@pytest.mark.order(9)
def test_server_add_error():
"""
Test server add error when adding a server with same name
Expand All @@ -434,6 +443,7 @@ def test_server_add_error():


@pytest.mark.requires_credentials
@pytest.mark.order(10)
def test_server_remove_error():
"""
Test server remove errors when there is no server with the provided name
Expand All @@ -444,6 +454,7 @@ def test_server_remove_error():


@pytest.mark.requires_credentials
@pytest.mark.order(11)
def test_server_list_empty():
"""
Test server list output when no servers are configured
Expand All @@ -454,6 +465,7 @@ def test_server_list_empty():


@pytest.mark.requires_credentials
@pytest.mark.order(12)
def test_add_server_token():
"""
Test server add with token
Expand Down
Loading