Skip to content
Snippets Groups Projects
Commit 6e2f574f authored by Jithu Murugan's avatar Jithu Murugan
Browse files

Revert "- Commented the failing tests to verify the coverage calculation"

This reverts commit e0262adc.
parent e0262adc
No related branches found
No related tags found
2 merge requests!6ci(dedal): implement coverage calculation for the library,!4feat(spack_operation): implement setup_spack_env functionality
......@@ -8,197 +8,197 @@ from dedal.tests.testing_variables import test_spack_env_git, ebrains_spack_buil
from dedal.utils.utils import file_exists_and_not_empty
# def test_spack_repo_exists_1():
# spack_operation = SpackOperationCreator.get_spack_operator()
# spack_operation.install_spack()
# assert spack_operation.spack_repo_exists('ebrains-spack-builds') == False
#
#
# def test_spack_repo_exists_2(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir)
# config = SpackConfig(env=env, install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# with pytest.raises(NoSpackEnvironmentException):
# spack_operation.spack_repo_exists(env.env_name)
#
#
# def test_spack_repo_exists_3(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir)
# config = SpackConfig(env=env, install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# print(spack_operation.get_spack_installed_version())
# spack_operation.setup_spack_env()
# assert spack_operation.spack_repo_exists(env.env_name) == False
#
#
# def test_spack_from_scratch_setup_1(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# assert spack_operation.spack_repo_exists(env.env_name) == False
#
#
# def test_spack_from_scratch_setup_2(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# config.add_repo(repo)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# assert spack_operation.spack_repo_exists(env.env_name) == True
#
#
# def test_spack_from_scratch_setup_3(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('new_env1', install_dir)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# config.add_repo(repo)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# with pytest.raises(BashCommandException):
# spack_operation.setup_spack_env()
#
#
# def test_spack_from_scratch_setup_4(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('new_env2', install_dir)
# config = SpackConfig(env=env, install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# assert spack_operation.spack_env_exists() == True
#
#
# def test_spack_not_a_valid_repo():
# env = SpackDescriptor('ebrains-spack-builds', Path(), None)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab')
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# with pytest.raises(BashCommandException):
# spack_operation.add_spack_repo(repo.path, repo.env_name)
#
#
# def test_spack_from_scratch_concretize_1(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# config.add_repo(repo)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=True)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_concretize_2(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# config.add_repo(repo)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=False)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_concretize_3(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# repo = env
# config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
# config.add_repo(repo)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == False
#
#
# def test_spack_from_scratch_concretize_4(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
# config = SpackConfig(env=env, install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=False)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_concretize_5(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
# config = SpackConfig(env=env, install_dir=install_dir)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=True)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_concretize_6(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
# repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# config = SpackConfig(env=env, install_dir=install_dir)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=False)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_concretize_7(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
# repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# config = SpackConfig(env=env)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=True)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
#
#
# def test_spack_from_scratch_install(tmp_path):
# install_dir = tmp_path
# env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
# repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
# config = SpackConfig(env=env)
# config.add_repo(repo)
# spack_operation = SpackOperationCreator.get_spack_operator(config)
# spack_operation.install_spack()
# spack_operation.setup_spack_env()
# spack_operation.concretize_spack_env(force=True)
# concretization_file_path = spack_operation.env_path / 'spack.lock'
# assert file_exists_and_not_empty(concretization_file_path) == True
# install_result = spack_operation.install_packages(jobs=2, signed=False, fresh=True, debug=False)
# assert install_result.returncode == 0
def test_spack_repo_exists_1():
spack_operation = SpackOperationCreator.get_spack_operator()
spack_operation.install_spack()
assert spack_operation.spack_repo_exists('ebrains-spack-builds') == False
def test_spack_repo_exists_2(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir)
config = SpackConfig(env=env, install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
with pytest.raises(NoSpackEnvironmentException):
spack_operation.spack_repo_exists(env.env_name)
def test_spack_repo_exists_3(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir)
config = SpackConfig(env=env, install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
print(spack_operation.get_spack_installed_version())
spack_operation.setup_spack_env()
assert spack_operation.spack_repo_exists(env.env_name) == False
def test_spack_from_scratch_setup_1(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
assert spack_operation.spack_repo_exists(env.env_name) == False
def test_spack_from_scratch_setup_2(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
config.add_repo(repo)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
assert spack_operation.spack_repo_exists(env.env_name) == True
def test_spack_from_scratch_setup_3(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('new_env1', install_dir)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
config.add_repo(repo)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
with pytest.raises(BashCommandException):
spack_operation.setup_spack_env()
def test_spack_from_scratch_setup_4(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('new_env2', install_dir)
config = SpackConfig(env=env, install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
assert spack_operation.spack_env_exists() == True
def test_spack_not_a_valid_repo():
env = SpackDescriptor('ebrains-spack-builds', Path(), None)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab')
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
with pytest.raises(BashCommandException):
spack_operation.add_spack_repo(repo.path, repo.env_name)
def test_spack_from_scratch_concretize_1(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
config.add_repo(repo)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=True)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_concretize_2(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
config.add_repo(repo)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=False)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_concretize_3(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
repo = env
config = SpackConfig(env=env, system_name='ebrainslab', install_dir=install_dir)
config.add_repo(repo)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == False
def test_spack_from_scratch_concretize_4(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
config = SpackConfig(env=env, install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=False)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_concretize_5(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
config = SpackConfig(env=env, install_dir=install_dir)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=True)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_concretize_6(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
config = SpackConfig(env=env, install_dir=install_dir)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=False)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_concretize_7(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
config = SpackConfig(env=env)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=True)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
def test_spack_from_scratch_install(tmp_path):
install_dir = tmp_path
env = SpackDescriptor('test-spack-env', install_dir, test_spack_env_git)
repo = SpackDescriptor('ebrains-spack-builds', install_dir, ebrains_spack_builds_git)
config = SpackConfig(env=env)
config.add_repo(repo)
spack_operation = SpackOperationCreator.get_spack_operator(config)
spack_operation.install_spack()
spack_operation.setup_spack_env()
spack_operation.concretize_spack_env(force=True)
concretization_file_path = spack_operation.env_path / 'spack.lock'
assert file_exists_and_not_empty(concretization_file_path) == True
install_result = spack_operation.install_packages(jobs=2, signed=False, fresh=True, debug=False)
assert install_result.returncode == 0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment