Skip to content

Commit 4e25f85

Browse files
committed
Rename progress-tests to progress-runner
- to use more consistent namings - also clean up and simplify Makefile
1 parent 7349bf1 commit 4e25f85

File tree

4 files changed

+26
-60
lines changed

4 files changed

+26
-60
lines changed

.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ builds:
6060
goarch:
6161
- amd64
6262
- arm64
63-
- id: "progress-tests"
63+
- id: "progress-runner"
6464
dir: ./progress
65-
binary: progress-tests
65+
binary: progress-runner
6666
command: test
6767
no_main_check: true
6868
env:

Makefile

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ else
44
EXT := ""
55
endif
66

7-
# Run with java by default when environment variable is not set
8-
LANG_IMPL_PATH ?= java
9-
107
CONFIG_PKG="github.com/murex/gamekit-coffeemachine/settings"
118
export CGO_ENABLED=0
129

@@ -48,13 +45,9 @@ $(cli_bin):
4845
-X ${CONFIG_PKG}.BuildAuthor="`id -un`" \
4946
"
5047

51-
.PHONY: run-cli
52-
run-cli: $(cli_bin)
53-
@$< $(LANG_IMPL_PATH)
54-
55-
progress_tests_bin := bin/progress-tests$(EXT)
56-
build: $(progress_tests_bin)
57-
$(progress_tests_bin):
48+
progress_runner_bin := bin/progress-runner$(EXT)
49+
build: $(progress_runner_bin)
50+
$(progress_runner_bin):
5851
@mkdir -p bin
5952
@go test -c -o $@ ./progress -ldflags "-s -w \
6053
-X ${CONFIG_PKG}.BuildVersion="`git describe --tags`" \
@@ -78,25 +71,9 @@ $(test2json_bin):
7871
@mkdir -p bin
7972
@go build -o $@ -ldflags="-s -w" cmd/test2json
8073

81-
define RUN_PROGRESS_TESTS
82-
mkdir -p _test_results
83-
export LANG_IMPL_PATH=$(1)
84-
export LANGUAGE=$(basename $(1))
85-
$(gotestsum_bin) \
86-
--format testdox \
87-
--junitfile _test_results/progress-tests-$(LANGUAGE).xml \
88-
--hide-summary=all \
89-
--raw-command \
90-
-- $(test2json_bin) -t -p progress-tests-$(LANGUAGE) bin/progress-tests$(EXT) -test.v=test2json
91-
endef
92-
93-
.PHONY: run-progress
94-
run-progress: $(progress_tests_bin) $(test2json_bin) $(gotestsum_bin)
95-
@$(call RUN_PROGRESS_TESTS,$(LANG_IMPL_PATH))
96-
9774
.PHONY: test
9875
test:
99-
@env LANG_IMPL_PATH=java gotestsum ./...
76+
@gotestsum ./...
10077

10178
.PHONY: clean
10279
clean:

dev-doc/build.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ make
8484

8585
This command generates all the gamification kit executables in the [bin](../bin) directory.
8686

87-
| Executable | Description |
88-
|----------------------------|------------------------------------------------------------------------------------|
89-
| `bin/progress-tests[.exe]` | Progress Runner executable. This is the test executable running all progress tests |
90-
| `bin/gotestsum[.exe]` | gotestsum executable used for running and rendering go test results (*) |
91-
| `bin/test2json[.exe]` | go tool used for converting raw go test results into json (*) |
92-
| `bin/cli[.exe]` | Command Line Interface utility |
93-
94-
(*) These executables are built here so that they can be re-distributed along with progress-tests executable
87+
| Executable | Description |
88+
|-----------------------------|------------------------------------------------------------------------------------|
89+
| `bin/progress-runner[.exe]` | Progress Runner executable. This is the test executable running all progress tests |
90+
| `bin/gotestsum[.exe]` | gotestsum executable used for running and rendering go test results (*) |
91+
| `bin/test2json[.exe]` | go tool used for converting raw go test results into json (*) |
92+
| `bin/cli[.exe]` | Command Line Interface utility |
93+
94+
(*) These executables are built here so that they can be re-distributed along with progress-runner executable
9595
without the need to have Go SDK installed on the end user machine.
9696

9797
## Run gamification kit executables
@@ -106,40 +106,29 @@ coffee machine implementation.
106106

107107
#### Default mode (one dot per test case)
108108

109-
Either:
110-
111-
```shell
112-
env LANG_IMPL_PATH=../kata-coffeemachine/java make run-progress
113-
```
114-
115-
Or:
116-
117109
```shell
118-
./run-progress-runner.sh ../kata-coffeemachine/java
110+
./progress-runner.sh ../kata-coffeemachine/java
119111
```
120112

121113
#### Verbose mode (one line per test case with test description)
122114

123115
```shell
124-
./run-progress-runner.sh ../kata-coffeemachine/java -v
116+
./progress-runner.sh ../kata-coffeemachine/java -v
125117
```
126118

127119
#### Very verbose mode (one line per test case with test description + failed tests output details)
128120

129121
```shell
130-
./run-progress-runner.sh ../kata-coffeemachine/java -vv
122+
./progress-runner.sh ../kata-coffeemachine/java -vv
131123
```
132124

133125
### Run the command line interface utility
134126

135-
Either:
136-
137127
```shell
138-
env LANG_IMPL_PATH=../kata-coffeemachine/java make run-cli
128+
./bin/cli ../kata-coffeemachine/java
139129
```
140-
141-
Or:
130+
## Clean up generated files and directories
142131

143132
```shell
144-
./bin/cli ../kata-coffeemachine/java
133+
make clean
145134
```

progress-runner.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,31 @@ mkdir -p _test_results
3939

4040
gotestsum_exe="${base_dir}/bin/gotestsum${extension}"
4141
test2json_exe="${base_dir}/bin/test2json${extension}"
42-
progress_tests_exe="${base_dir}/bin/progress-tests${extension}"
42+
progress_runner_exe="${base_dir}/bin/progress-runner${extension}"
4343

44-
package_name=progress-tests-"${language}"
45-
junitfile=_test_results/progress_tests-"${language}".xml
44+
package_name=progress-runner-"${language}"
45+
junitfile=_test_results/progress_runner-"${language}".xml
4646
if [ "${trace_mode}" == "-vv" ]; then
4747
# Prints test names and failed tests output
4848
${gotestsum_exe} \
4949
--format testdox \
5050
--junitfile "${junitfile}" \
5151
--raw-command \
52-
-- "${test2json_exe}" -t -p "${package_name}" "${progress_tests_exe}" -test.v=test2json
52+
-- "${test2json_exe}" -t -p "${package_name}" "${progress_runner_exe}" -test.v=test2json
5353
elif [ "${trace_mode}" == "-v" ]; then
5454
# Prints test names but not failed tests output
5555
${gotestsum_exe} \
5656
--format testdox \
5757
--hide-summary=all \
5858
--junitfile "${junitfile}" \
5959
--raw-command \
60-
-- "${test2json_exe}" -t -p "${package_name}" "${progress_tests_exe}" -test.v=test2json
60+
-- "${test2json_exe}" -t -p "${package_name}" "${progress_runner_exe}" -test.v=test2json
6161
else
6262
# Prints dots only
6363
${gotestsum_exe} \
6464
--format dots \
6565
--hide-summary=all \
6666
--junitfile "${junitfile}" \
6767
--raw-command \
68-
-- "${test2json_exe}" -t -p "${package_name}" "${progress_tests_exe}" -test.v=test2json
68+
-- "${test2json_exe}" -t -p "${package_name}" "${progress_runner_exe}" -test.v=test2json
6969
fi

0 commit comments

Comments
 (0)