[wip] slightly better defaults

This commit is contained in:
Michael Bradley, Jr 2022-09-16 08:07:04 -05:00 committed by Dmitriy Ryajov
parent 2b0d4af94f
commit ecbef6dcd1
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
4 changed files with 9 additions and 8 deletions

View File

@ -132,20 +132,21 @@ coverage:
genhtml coverage/coverage.f.info --output-directory coverage/report
if which open >/dev/null; then (echo -e "\e[92mOpening\e[39m HTML coverage report in browser..." && open coverage/report/index.html) || true; fi
SCRATCH_IGNORE ?= "\.update\.timestamp\|Would skip\|build/\|codex\.nims\|nimcache/\|scratch/\|vendor/\.nimble"
TESTGROUND_BUILDER ?= docker:generic
TESTGROUND_OPTIONS ?= --instances=2
TESTGROUND_PLAN ?= simple_tcp_ping
TESTGROUND_RUNNER ?= local:docker
TESTGROUND_TESTCASE ?= simple_tcp_ping
TESTGROUND_TESTCASE ?= default
TESTGROUND_SCRATCH_IGNORE ?= "\.update\.timestamp\|Would skip\|build/\|codex\.nims\|nimcache/\|scratch/\|vendor/\.nimble"
testground:
mkdir -p scratch && rm -rf scratch/* && git clone --depth=1 "file://$${PWD}" "scratch/$$(basename $${PWD})"
[[ $$(git status --porcelain) == "" ]] || (git diff --merge-base HEAD > "scratch/$$(basename $${PWD})/scratch.patch")
[[ $$(git status --porcelain) == "" ]] || (cd "scratch/$$(basename $${PWD})" && git apply --allow-empty scratch.patch)
rm -f "scratch/$$(basename $${PWD})/scratch.patch"
git clean -ndfx | grep -v $(SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} bash -c "test -d '{}' && echo '{}' || true" | xargs -I{} mkdir -p scratch/nim-codex/{}
git clean -ndfx | grep -v $(SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} cp -R {} scratch/nim-codex/{}
git clean -ndfx | grep -v $(TESTGROUND_SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} bash -c "test -d '{}' && echo '{}' || true" | xargs -I{} mkdir -p scratch/nim-codex/{}
git clean -ndfx | grep -v $(TESTGROUND_SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} cp -R {} scratch/nim-codex/{}
echo >> scratch/nim-codex/config.nims && cat testground/$(TESTGROUND_PLAN)/config.nims >> scratch/nim-codex/config.nims
testground plan import --from=testground/$(TESTGROUND_PLAN)
testground run single --builder=$(TESTGROUND_BUILDER) --runner=$(TESTGROUND_RUNNER) --plan=$(TESTGROUND_PLAN) --testcase=$(TESTGROUND_TESTCASE) $(TESTGROUND_OPTIONS)

View File

@ -11,6 +11,6 @@ RUN cd /extra/scratch/nim-codex && \
make USE_SYSTEM_NIM=1 update
RUN cd /extra/scratch/nim-codex && \
make USE_SYSTEM_NIM=1 TESTGROUND_PLAN=hello_codex testground_exec
make USE_SYSTEM_NIM=1 TESTGROUND_PLAN=simple_libp2p testground_exec
ENTRYPOINT ["/extra/scratch/nim-codex/build/codex_testground"]

View File

@ -1,4 +1,4 @@
name = "hello_codex"
name = "simple_libp2p"
[defaults]
builder = "docker:generic"
runner = "local:docker"
@ -10,7 +10,7 @@ enabled = true
enabled = true
[[testcases]]
name= "hello"
name= "default"
instances = { min = 2, default = 2, max = 200 }
[extra_sources]

View File

@ -10,7 +10,7 @@ enabled = true
enabled = true
[[testcases]]
name= "simple_tcp_ping"
name= "default"
instances = { min = 2, default = 2, max = 2 }
[testcases.params]