Merge pull request #3557 from SaloEater/use_docker_for_testing

Use docker for testing
This commit is contained in:
Trevor Lund
2022-01-21 01:00:01 -06:00
committed by GitHub
3 changed files with 33 additions and 0 deletions

3
.gitignore vendored
View File

@@ -15,6 +15,9 @@ Settings.xml
# Testing
luajit/
spec/test_results.log
spec/test_generation.log
src/luacov.stats.out
# Release
manifest-updated.xml

View File

@@ -125,6 +125,12 @@ More tests can be added to this folder to test specific functionality, or new te
2. Run `luarocks install busted`
3. Run `busted --lua=luajit` from the command line. You may need to add `luajit` to your PATH
Docker alternative:
1. Install [Docker](https://www.docker.com/get-started)
2. Run `docker-compose up -d` from the command line
3. View last results in `spec/test_results.log`
### Creating new test builds or fixing an existing build
Sometimes a change will be made that intends to change the stats garnered by PoB, which will break our tests.
@@ -132,6 +138,11 @@ Sometimes a change will be made that intends to change the stats garnered by PoB
2. Run `busted --lua=luajit -r generate` to generate a LUA file that contains the current stats of that build
3. Run `busted --lua=luajit` and the tests should pass
Docker alternative:
1. Add the new build XML (if applicable) to the `TestBuilds` folder
2. Run `docker-compose up -d` to generate a LUA file that contains the current stats of that build and run the tests
## Keeping your fork up to date
Note: This tutorial assumes that you are already familiar with Git and basic command line tools.

19
docker-compose.yml Normal file
View File

@@ -0,0 +1,19 @@
version: "3.8"
services:
busted-tests:
image: summ1else/poe-busted-image
container_name: busted-tests
command: bash -c "rm -f spec/test_results.log && busted --lua=luajit | tee spec/test_results.log"
volumes:
- ./:/root
depends_on:
- busted-generate-build
busted-generate-build:
image: summ1else/poe-busted-image
container_name: busted-generate-build
command: bash -c "rm -f spec/test_generation.log && busted --lua=luajit -r generate | tee spec/test_generation.log"
restart: "no"
volumes:
- ./:/root