diff --git a/cachito/web/static/api_v1.yaml b/cachito/web/static/api_v1.yaml index 2019bfebb..ce25ef27e 100644 --- a/cachito/web/static/api_v1.yaml +++ b/cachito/web/static/api_v1.yaml @@ -1219,9 +1219,6 @@ components: GOPATH: value: deps/gomod kind: path - GOSUMDB: - value: off - kind: literal GOTOOLCHAIN: value: local kind: literal diff --git a/cachito/workers/config.py b/cachito/workers/config.py index 435bf9556..e894d45d8 100644 --- a/cachito/workers/config.py +++ b/cachito/workers/config.py @@ -29,9 +29,6 @@ class Config(object): cachito_archives_minimum_age_days = 365 cachito_auth_type: Optional[str] = None cachito_default_environment_variables = { - "gomod": { - "GOSUMDB": {"value": "off", "kind": "literal"}, - }, "npm": { "CHROMEDRIVER_SKIP_DOWNLOAD": {"value": "true", "kind": "literal"}, "CYPRESS_INSTALL_BINARY": {"value": "0", "kind": "literal"}, @@ -162,7 +159,6 @@ class TestingConfig(DevelopmentConfig): cachito_default_environment_variables = { "gomod": { "GO111MODULE": {"value": "on", "kind": "literal"}, - "GOSUMDB": {"value": "off", "kind": "literal"}, }, "npm": { "CHROMEDRIVER_SKIP_DOWNLOAD": {"value": "true", "kind": "literal"}, diff --git a/cachito/workers/pkg_managers/gomod.py b/cachito/workers/pkg_managers/gomod.py index ff41dff3e..459830e91 100644 --- a/cachito/workers/pkg_managers/gomod.py +++ b/cachito/workers/pkg_managers/gomod.py @@ -313,6 +313,7 @@ def resolve_gomod(app_source_path, request, dep_replacements=None, git_dir_path= "PATH": os.environ.get("PATH", ""), "GOMODCACHE": "{}/pkg/mod".format(temp_dir), "GOTOOLCHAIN": "auto", + "GOSUMDB": "sum.golang.org", } if "cgo-disable" in request.get("flags", []): env["CGO_ENABLED"] = "0" diff --git a/tests/helper_utils/__init__.py b/tests/helper_utils/__init__.py index 47ea5ba77..4152b40ac 100644 --- a/tests/helper_utils/__init__.py +++ b/tests/helper_utils/__init__.py @@ -4,12 +4,13 @@ from typing import Union -def assert_directories_equal(dir_a, dir_b, ignore_files=[]): +def assert_directories_equal(dir_a, dir_b, ignore_files=()): """ Check recursively directories have equal content. :param dir_a: first directory to check :param dir_b: second directory to check + :param ignore_files: a sequence of file names to be ignored in the comparisons """ ignore_files = list(set(filecmp.DEFAULT_IGNORES).union(ignore_files)) dirs_cmp = filecmp.dircmp(dir_a, dir_b, ignore=ignore_files) diff --git a/tests/test_workers/test_tasks/test_gomod.py b/tests/test_workers/test_tasks/test_gomod.py index 162fd58d4..089a48fbd 100644 --- a/tests/test_workers/test_tasks/test_gomod.py +++ b/tests/test_workers/test_tasks/test_gomod.py @@ -113,7 +113,6 @@ def directory_present(*args, **kwargs): # Add the default environment variables from the configuration env_vars = { "GO111MODULE": {"value": "on", "kind": "literal"}, - "GOSUMDB": {"value": "off", "kind": "literal"}, } sample_env_vars.update(env_vars)