Skip to content

Commit

Permalink
Switch from SVN to Git for test_checkout_tool_as_dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Dec 5, 2023
1 parent 2246c17 commit 8f114a3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 28 deletions.
10 changes: 5 additions & 5 deletions tests/test-recipes/metadata/_checkout_tool_as_dependency/bld.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
svn upgrade
svn info
:: ensure checkout worked as expected
git status
if errorlevel 1 exit 1
for /f "delims=" %%i in ('svn info ^| findstr "Revision"') do set svnrev=%%i

:: ensure the expected commit was checked out
for /f "delims=" %%i in ('git rev-parse HEAD') do if not "%%i"=="2a558a86bb77b1d21a0be77c3775464500e9dfe2" echo "exit 1"
if errorlevel 1 exit 1
echo %svnrev%
if not "%svnrev%"=="Revision: 1" exit 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Ensure the checkout went well
# Think of the non-English speaking world
export LC_ALL=C
svn upgrade
svn info
[ "$(svn info | grep "Revision")" = "Revision: 1" ]
# ensure checkout worked as expected
git status || exit 1

# ensure the expected commit was checked out
[[ "$(git rev-parse HEAD)" == "2a558a86bb77b1d21a0be77c3775464500e9dfe2" ]]
15 changes: 5 additions & 10 deletions tests/test-recipes/metadata/_checkout_tool_as_dependency/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
{% set recipe_dir = RECIPE_DIR if unix else "/" ~ RECIPE_DIR.replace("\\", "/") %}

package:
name: test-checkout-tool-as-dependency
version: 1.0

source:
svn_url: https://github.com/conda/conda_build_test_recipe.git
svn_rev: 1
git_url: https://github.com/conda/conda_build_test_recipe.git
git_rev: 1.0

requirements:
build:
# To test the conda_build version
- svn
- vc 9 # [win and py2k]
- vc 14 # [win and py3k]
# This is here so that we get a smaller host prefix to speed up
# the excruciatingly slow calls to prefix_files (os.walk).
- git
host:
# This is here so that we get a smaller host prefix to speed up
# the excruciatingly slow calls to prefix_files (os.walk).
- bzip2
10 changes: 3 additions & 7 deletions tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,11 @@ def dummy_executable(folder, exename):


def test_checkout_tool_as_dependency(testing_workdir, testing_config, monkeypatch):
# "hide" svn by putting a known bad one on PATH
exename = dummy_executable(testing_workdir, "svn")
# "hide" git by putting a known bad one on PATH
exename = dummy_executable(testing_workdir, "git")
monkeypatch.setenv("PATH", testing_workdir, prepend=os.pathsep)
FNULL = open(os.devnull, "w")
with pytest.raises(subprocess.CalledProcessError):
check_call_env([exename, "--version"], stderr=FNULL)
FNULL.close()
env = os.environ.copy()
env["PATH"] = os.pathsep.join([testing_workdir, env["PATH"]])
check_call_env([exename, "--version"], stderr=subprocess.DEVNULL)
testing_config.activate = True
api.build(
os.path.join(metadata_dir, "_checkout_tool_as_dependency"),
Expand Down

0 comments on commit 8f114a3

Please sign in to comment.