Skip to content

Commit

Permalink
Make test__cached_dependencies use git variables from test_env_vars.yaml
Browse files Browse the repository at this point in the history
STONEBLD-661

Signed-off-by: Felipe de Almeida <fdealmei@redhat.com>
  • Loading branch information
fepas authored and taylormadore committed Mar 16, 2023
1 parent 27161e4 commit 7a40552
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
24 changes: 0 additions & 24 deletions tests/integration/test_data/cached_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@ cached_package:
ssh_url: "./tmp/cachito-archives/integration-tests-git-repo.git"
# The URL of the repository
https_url: "./tmp/cachito-archives/integration-tests-git-repo.git"
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# Package managers
pkg_managers: ["gomod"]
# Test pip with cached dependencies
pip_cached_deps:
# Use local version of repos.
# <use_local: True> is not supported in local environment and will be skipped.
use_local: True
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# HTTPS and SSH links to main and dependency repos respectively
https_main_repo: https://github.com/cachito-testing/cachito-pip-with-deps.git
https_dep_repo: https://github.com/cachito-testing/cachito-pip-without-deps.git
Expand Down Expand Up @@ -123,10 +115,6 @@ gomod_cached_deps:
# Use local version of repos.
# <use_local: True> is not supported in local environment and will be skipped.
use_local: True
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# HTTPS and SSH links to main and dependency repos respectively
https_main_repo: https://github.com/cachito-testing/cachito-gomod-with-deps.git
https_dep_repo: https://github.com/cachito-testing/cachito-gomod-without-deps.git
Expand Down Expand Up @@ -607,10 +595,6 @@ npm_cached_deps:
# Use local version of repos.
# <use_local: True> is not supported in local environment and will be skipped.
use_local: True
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# HTTPS and SSH links to main and dependency repos respectively
https_main_repo: https://github.com/cachito-testing/cachito-npm-with-deps.git
https_dep_repo: https://github.com/cachito-testing/cachito-npm-without-deps.git
Expand Down Expand Up @@ -769,10 +753,6 @@ yarn_cached_deps:
# Use local version of repos.
# <use_local: True> is not supported in local environment and will be skipped.
use_local: True
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# HTTPS and SSH links to main and dependency repos respectively
https_main_repo: https://github.com/cachito-testing/cachito-yarn-with-deps.git
https_dep_repo: https://github.com/cachito-testing/cachito-yarn-without-deps.git
Expand Down Expand Up @@ -940,10 +920,6 @@ rubygems_cached_deps:
# Use local version of repos.
# <use_local: True> is not supported in local environment and will be skipped.
use_local: True
# test repo user
git_user: "Arthur Dent"
# test repo user email
git_email: "dent42@cachito.rocks"
# HTTPS and SSH links to main and dependency repos respectively
https_main_repo: https://github.com/cachito-testing/cachito-rubygems-with-dependencies.git
https_dep_repo: https://github.com/cachito-testing/cachito-rubygems-without-deps.git
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_using_cached_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def setup_method_fixture(self, test_env):
"""Create bare git repo and a pool for removing shared directories."""
self.directories = []
self.env_data = utils.load_test_data("cached_dependencies.yaml")["cached_package"]
self.git_user = self.env_data["test_repo"].get("git_user")
self.git_email = self.env_data["test_repo"].get("git_email")
self.git_user = test_env["git_user"]
self.git_email = test_env["git_email"]
if self.env_data["test_repo"].get("use_local"):
repo_path = create_local_repository(self.env_data["test_repo"]["ssh_url"])
self.env_data["test_repo"]["ssh_url"] = repo_path
Expand Down Expand Up @@ -166,8 +166,8 @@ def test_package_with_cached_deps(self, test_env, tmpdir, env_name):
if self.use_local:
pytest.skip("The local repos are not supported for the test")

self.git_user = env_data.get("git_user")
self.git_email = env_data.get("git_email")
self.git_user = test_env["git_user"]
self.git_email = test_env["git_email"]

# Download dependency repo into a new directory
dep_repo_dir = os.path.join(tmpdir, "dep")
Expand Down

0 comments on commit 7a40552

Please sign in to comment.