klarna / bec

The BitBucket Erlang Client
Apache License 2.0
47 stars 12 forks source link

50 run tests requiring a bitbucket server in GitHub actions #52

Closed jesperes closed 2 years ago

jesperes commented 2 years ago

This is a rather large PR which adds support for running the PropEr tests in prop_api.erl and prop_yml.erl. These tests require a running Bitbucket Server instance, which is the reason these have not been run before. This also caused problems because PRs opened against the GitHub repo were not being tested properly. (These tests were only run internally at Klarna.)

To spin up a Bitbucket Server instance, the build.yml workflow has been modified to start a Bitbucket service using the atlassian/bitbucket-server:7.17.1 Docker image. It uses a "time-bomb" license retrieved from here which will automatically expire after three hours.

There is also a docker-compose setup in scripts/pre-test-hook.sh which is invoked automatically when running rebar3 proper locally. (Currently, to run these tests locally, you must use the run-tests-with-bb.sh script, but I hope to fix so that won't be necessary, and users should be able to just run rebar3 proper to test things, and things should "just work".

jesperes commented 2 years ago

Caveat: the workzone and hook tests will not be run, since these require additional plugins installed in Bitbucket.