forked from bet365/soap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix tests, upgrade to rebar3 (#1)
- Loading branch information
1 parent
856b5c4
commit 29ebfc6
Showing
8 changed files
with
218 additions
and
197 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 |
---|---|---|
|
@@ -11,4 +11,4 @@ rel/example_project | |
.rebar | ||
*~ | ||
logs | ||
rebar.lock | ||
/_build |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM erlang:20-alpine | ||
|
||
ARG UID | ||
ARG GID | ||
|
||
RUN apk add --no-cache make git && \ | ||
addgroup -S -g "$UID" app && \ | ||
adduser -S -u "$UID" -G app app | ||
|
||
WORKDIR /home/app/src | ||
|
||
USER app |
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,32 +1,32 @@ | ||
.PHONY: all compile clean ct test_deps | ||
APP := bet365-soap | ||
|
||
.PHONY: all compile ct clean docker-build docker | ||
|
||
all: compile | ||
|
||
compile: | ||
@echo "Fetching dependencies..." | ||
@rebar get-deps | ||
@echo "Compiling..." | ||
@rebar compile | ||
|
||
ct: compile test_deps | ||
@echo "Running common tests..." | ||
-@ct_run -noshell -pa ebin \ | ||
-pa deps/*/ebin \ | ||
-pa test/deps/*/ebin \ | ||
-name test \ | ||
-logdir ./logs \ | ||
-env TEST_DIR ./test \ | ||
-spec ./test/test_specs.spec \ | ||
-dir test >> ./logs/raw.log 2>&1 | ||
@grep -h "TEST COMPLETE" logs/raw.log | tail -1 | ||
rebar3 get-deps | ||
rebar3 compile | ||
|
||
test_deps: | ||
@echo "Checking dependencies for test..." | ||
@cd test && rebar get-deps && rebar compile && cd .. | ||
ct: | ||
rebar3 ct | ||
|
||
clean: | ||
@rebar clean | ||
@cd test && rebar clean && cd .. | ||
rebar3 clean | ||
|
||
docker-build: | ||
docker build \ | ||
--tag $(APP) \ | ||
--build-arg UID=$(shell id -u) \ | ||
--build-arg GID=$(shell id -g) \ | ||
$(PWD) | ||
|
||
distclean: clean | ||
@rm -rf ./deps/ && rm -rf ./test/deps/ | ||
docker: docker-build | ||
docker run \ | ||
--rm \ | ||
--tty=true \ | ||
--interactive=true \ | ||
--name $(APP) \ | ||
--volume "$(PWD):/home/app/src" \ | ||
--workdir=/home/app/src \ | ||
$(APP) sh |
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,8 +1,15 @@ | ||
{erl_opts, [debug_info]}. | ||
{deps, [{erlsom, "1.4.2"}]}. | ||
|
||
{deps, [ | ||
{erlsom, ".*", {git, "https://github.com/willemdj/erlsom.git", {tag, "v1.4.0"}}} | ||
{erl_opts, [debug_info]}. | ||
|
||
]}. | ||
|
||
{ct_extra_params, "-spec test/test_specs.spec"}. | ||
{profiles, [ | ||
{test, [ | ||
{deps, [ | ||
{ibrowse, ".*", {git, "https://github.com/cmullaparthi/ibrowse.git", {tag, "v4.2.2"} }}, | ||
{cowboy, "1.1.2"}, | ||
{mochiweb, "2.22.0"} | ||
]}, | ||
{ct_extra_params, "-spec test/test_specs.spec"}, | ||
{erl_opts, [debug_info]} | ||
]} | ||
]}. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{"1.2.0", | ||
[{<<"erlsom">>,{pkg,<<"erlsom">>,<<"1.4.2">>},0}]}. | ||
[ | ||
{pkg_hash,[ | ||
{<<"erlsom">>, <<"5CDDB82FB512F406F61162E511AE86582F824F0DCCDA788378B18A00D89C1B3F">>}]}, | ||
{pkg_hash_ext,[ | ||
{<<"erlsom">>, <<"AC989E850A5A4C1641694F77506804710315F3D1193C977A36B223A32859EDD3">>}]} | ||
]. |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.