From edc00bf4c67851c6bac4452f10b7307e2a36d8eb Mon Sep 17 00:00:00 2001 From: Ableytner Date: Sun, 10 Mar 2024 05:11:07 +0100 Subject: [PATCH] add test workflow secrets --- .github/workflows/run-pytest.yml | 9 +++++++++ mcserverwrapper/test/helpers.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index 44345ad..0627cae 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -34,6 +34,15 @@ jobs: with: distribution: 'temurin' java-version: '21' + - name: Save secrets to file + env: + USERNAME: ${{ secrets.MCUSERNAME }} + PASSWORD: ${{ secrets.MCPASSWORD }} + run: | + touch password.txt + echo $env:USERNAME >> password.txt + echo $env:PASSWORD >> password.txt + shell: bash - name: Run all tests with pytest run: | pytest diff --git a/mcserverwrapper/test/helpers.py b/mcserverwrapper/test/helpers.py index bcce31d..126d5fe 100644 --- a/mcserverwrapper/test/helpers.py +++ b/mcserverwrapper/test/helpers.py @@ -85,7 +85,7 @@ def connect_mineflayer(address = "127.0.0.1", port = 25565, offline_mode=False): if not offline_mode: with open("password.txt", "r", encoding="utf8") as f: - password = f.read().split("\n", maxsplit=1) + password = f.read().split("\n") bot = mineflayer.createBot({ 'host': address, 'port': port,