diff --git a/.gitignore b/.gitignore index a47b0918..0a3643ae 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ Settings.xml # Testing luajit/ +spec/test_results.log +spec/test_generation.log +src/luacov.stats.out # Release manifest-updated.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33a7f699..51a2d9ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..ebb2a04a --- /dev/null +++ b/docker-compose.yml @@ -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