-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: install git user config in test projects, docker
- Loading branch information
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.8.12-slim-buster | ||
FROM python:3.9-slim-buster | ||
|
||
# system installs first -- unlikely to change | ||
RUN apt-get update \ | ||
|
@@ -20,5 +20,7 @@ RUN poetry install && poetry update | |
ADD . /app | ||
ADD ./bin/create-sample-project.sh bin/create-sample-project.sh | ||
RUN sed -i.bak 's/\r$//' bin/create-sample-project.sh | ||
RUN git config --global user.email "[email protected]" | ||
RUN git config --global user.name "Dummy User" | ||
RUN poetry exec create-sample-project example sample-project-basic | ||
ENTRYPOINT [ "/bin/bash" ] | ||
ENTRYPOINT [ "/bin/bash", "-c" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,11 @@ def fix_empty_kedro_repo_session( | |
save_cache, | ||
): | ||
if save_cache: | ||
create_sample_project("test", kd_repo_path=str(APP_DIR)) | ||
create_sample_project( | ||
"test", | ||
kd_repo_path=str(APP_DIR), | ||
initial_commit_hook=_initial_commit_with_dummy_user, | ||
) | ||
for path in pathlib.Path("tmp/test").iterdir(): | ||
shutil.move(str(path), ".") | ||
shutil.rmtree("tmp") | ||
|
@@ -203,6 +207,18 @@ def fix_kd_context(empty_repo: DvcRepo) -> KDContext: | |
return KDContext(empty_repo.root_dir) | ||
|
||
|
||
def _initial_commit_with_dummy_user() -> None: | ||
""" | ||
Initial commit of test sample project with dummy user. | ||
""" | ||
subprocess.check_call(["git", "config", "user.name", "dummy_user"]) | ||
subprocess.check_call( | ||
["git", "config", "user.email", "[email protected]"] | ||
) | ||
subprocess.check_call(["git", "add", "."]) | ||
subprocess.check_call(["git", "commit", "-m", "chore: initial commit"]) | ||
|
||
|
||
def clear_fixture_cache() -> None: # pragma: no cover | ||
""" | ||
Removes the cached fixtures. | ||
|