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

Remove mentions of Travis CI #126

Merged
merged 2 commits into from
Dec 22, 2023
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
106 changes: 0 additions & 106 deletions .travis.yml

This file was deleted.

5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
io.open('msal_extensions/__init__.py', encoding='utf_8_sig').read()
).group(1)

try:
long_description = open('README.md').read()
except OSError:
long_description = "README.md is not accessible on TRAVIS CI's Python 3.5"
long_description = open('README.md').read()

setup(
name='msal-extensions',
Expand Down
15 changes: 7 additions & 8 deletions tests/test_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def _is_env_var_defined(env_var):

# Note: If you use tox, remember to pass them through via tox.ini
# https://tox.wiki/en/latest/example/basic.html#passing-down-environment-variables
is_running_on_travis_ci = _is_env_var_defined("TRAVIS")
is_running_on_github_ci = _is_env_var_defined("GITHUB_ACTIONS")

@pytest.fixture
Expand All @@ -46,45 +45,45 @@ def test_nonexistent_file_persistence(temp_location):
_test_nonexistent_persistence(FilePersistence(temp_location))

@pytest.mark.skipif(
is_running_on_travis_ci or not sys.platform.startswith('win'),
not sys.platform.startswith('win'),
reason="Requires Windows Desktop")
def test_file_persistence_with_data_protection(temp_location):
try:
_test_persistence_roundtrip(FilePersistenceWithDataProtection(temp_location))
except PersistenceDecryptionError:
if is_running_on_github_ci or is_running_on_travis_ci:
if is_running_on_github_ci:
logging.warning("DPAPI tends to fail on Windows VM. Run this on your desktop to double check.")
else:
raise

@pytest.mark.skipif(
is_running_on_travis_ci or not sys.platform.startswith('win'),
not sys.platform.startswith('win'),
reason="Requires Windows Desktop")
def test_nonexistent_file_persistence_with_data_protection(temp_location):
_test_nonexistent_persistence(FilePersistenceWithDataProtection(temp_location))

@pytest.mark.skipif(
not sys.platform.startswith('darwin'),
reason="Requires OSX. Whether running on TRAVIS CI does not seem to matter.")
reason="Requires OSX.")
def test_keychain_persistence(temp_location):
_test_persistence_roundtrip(KeychainPersistence(temp_location))

@pytest.mark.skipif(
not sys.platform.startswith('darwin'),
reason="Requires OSX. Whether running on TRAVIS CI does not seem to matter.")
reason="Requires OSX.")
def test_nonexistent_keychain_persistence(temp_location):
random_service_name = random_account_name = str(id(temp_location))
_test_nonexistent_persistence(
KeychainPersistence(temp_location, random_service_name, random_account_name))

@pytest.mark.skipif(
is_running_on_travis_ci or not sys.platform.startswith('linux'),
not sys.platform.startswith('linux'),
reason="Requires Linux Desktop. Headless or SSH session won't work.")
def test_libsecret_persistence(temp_location):
_test_persistence_roundtrip(LibsecretPersistence(temp_location))

@pytest.mark.skipif(
is_running_on_travis_ci or not sys.platform.startswith('linux'),
not sys.platform.startswith('linux'),
reason="Requires Linux Desktop. Headless or SSH session won't work.")
def test_nonexistent_libsecret_persistence(temp_location):
random_schema_name = random_value = str(id(temp_location))
Expand Down
30 changes: 12 additions & 18 deletions tests/test_windows_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,18 @@ def test_dpapi_roundtrip_with_entropy():
uuid.uuid4().hex,
]

try:
for tc in test_cases:
ciphered = subject_with_entropy.protect(tc)
assert ciphered != tc

got = subject_with_entropy.unprotect(ciphered)
assert got == tc

ciphered = subject_without_entropy.protect(tc)
assert ciphered != tc

got = subject_without_entropy.unprotect(ciphered)
assert got == tc
except OSError as exp:
if exp.errno == errno.EIO and os.getenv('TRAVIS_REPO_SLUG'):
pytest.skip('DPAPI tests are known to fail in TravisCI. This effort tracked by '
'https://github.com/AzureAD/microsoft-authentication-extentions-for-python'
'/issues/21')
for tc in test_cases:
ciphered = subject_with_entropy.protect(tc)
assert ciphered != tc

got = subject_with_entropy.unprotect(ciphered)
assert got == tc

ciphered = subject_without_entropy.protect(tc)
assert ciphered != tc

got = subject_without_entropy.unprotect(ciphered)
assert got == tc


def test_read_msal_cache_direct():
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312
[testenv]
deps = pytest
passenv =
TRAVIS
GITHUB_ACTIONS

commands =
Expand Down