Skip to content

Commit

Permalink
Merge pull request #30 from holgerverse/dev
Browse files Browse the repository at this point in the history
Added: Generation for test folders
  • Loading branch information
holgerson97 authored Jul 8, 2022
2 parents 802e93f + 0e9db4e commit bd98b75
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DEFAULT: help

NUMBER_OF_TESTS = 10

.PHONY: help
help:
@echo 'Makefile for "holgersync" development.'
Expand All @@ -23,6 +25,10 @@ build-holgersync:
go-get-dependencies:
go mod tidy

.PHONY: create-test-env
create-test-env:
sh scripts/create_test_env.sh $(NUMBER_OF_TESTS) $(GIT_USERNAME) $(GIT_PERSONAL_ACCESS_TOKEN)

.PHONY: clean-tests
clean-tests:
find -f tests/test_folder* | xargs rm -rf
find -f tests/* | xargs rm -rf
25 changes: 25 additions & 0 deletions scripts/create_test_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

touch tests/holgersyncfile.yml

cat <<EOT > tests/holgersyncfile.yml
HolgersyncConfig:
SourceFileConfig:
filePath: tests/source_test.json
Targets:
EOT

for ((i = 0; i < $1; i++)); do

cat <<EOT >> tests/holgersyncfile.yml
- path: tests/tests/test_folder_$((i+1))
gitConfig:
- username: $2
personalAccessToken: $3
remote: origin
EOT

mkdir -p tests/test_folder_$((i+1))

done

0 comments on commit bd98b75

Please sign in to comment.