Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folia E2E tests #142

Merged
merged 11 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/e2e_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- velocity
- bungeecord
- waterfall
folia:
- false
- true
uses: ./.github/workflows/e2e_test.yml
with:
proxy: ${{ matrix.proxy }}
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/e2e_notable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ jobs:
build:
name: Build
uses: ./.github/workflows/nightly.yml
test:
paper:
name: E2E test
needs: build
strategy:
fail-fast: false
matrix:
version:
- 1.20.4
- 1.16.5
- 1.16.3
- 1.13.2
Expand All @@ -33,3 +32,22 @@ jobs:
with:
proxy: ${{ matrix.proxy }}
version: ${{ matrix.version }}
paper-folia:
name: E2E test (with Folia)
needs: build
strategy:
fail-fast: false
matrix:
version:
- 1.20.4
proxy:
- velocity
- bungeecord
folia:
- false
- true
uses: ./.github/workflows/e2e_test.yml
with:
proxy: ${{ matrix.proxy }}
version: ${{ matrix.version }}
folia: ${{ matrix.folia }}
5 changes: 4 additions & 1 deletion .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ on:
proxy:
required: true
type: string
folia:
type: boolean
version:
required: true
type: string

jobs:
test:
name: E2E test (${{ inputs.version }}, ${{ inputs.proxy }})
name: E2E test (${{ inputs.version }}, proxy=${{ inputs.proxy }}, folia=${{ inputs.folia }})
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests_e2e
env:
# Legacy builder doesn't seem to properly mount /data folder inside server container for some reason
DOCKER_BUILDKIT: 1
FOLIA: "${{ inputs.folia && '1' || '0' }}"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If you have any questions, please [join my Discord][Discord].
| [JourneyMap] | v5.7.1 / Minecraft 1.16.5 | v5.9.9 / Minecraft 1.20.1 | ✅ Supported |
| VoxelMap | [v1.7.10][VoxelMap (old)] / Minecraft 1.8 | [v1.12.x][VoxelMap] / Minecraft 1.20.1 | ✅ Supported<sup class="reference">[[2]](https://github.com/turikhay/MapModCompanion/issues/8)</sup> |

[Folia](https://papermc.io/software/folia) is supported, but isn't tested regularly. Please report if the support is broken.
[Folia](https://papermc.io/software/folia) is supported, but isn't tested thoroughly. Please report if the support is broken.

## Installation

Expand Down
14 changes: 7 additions & 7 deletions tests_e2e/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
certifi==2023.11.17
charset-normalizer==3.3.2
idna==3.7
PyYAML==6.0.1
requests==2.32.0
toml==0.10.2
urllib3==2.1.0
certifi>=2023.11.17
charset-normalizer>=3.3.2
idna>=3.7
PyYAML>=6.0.1
requests>=2.32.0
toml>=0.10.2
urllib3>=2.1.0
32 changes: 30 additions & 2 deletions tests_e2e/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
'1.20.1',
'1.20.2',
'1.20.3',
))
),
**(
dict((
version,
{
'folia': True,
},
) for version in (
'1.20.4',
))
),
Expand Down Expand Up @@ -222,11 +231,22 @@ def save(data):
if enable_blue:
logger.info("Use 127.0.0.1:9011 for blue server")

enable_folia = environ.get("FOLIA") == "1"

proxy_type, client_version, action = argv[1:]

version_info = VERSIONS[client_version]

test_name = f"mmc_test_{proxy_type}_{client_version}"
if enable_folia and ("folia" not in version_info or not version_info["folia"]):
logger.info(f"Skipping: Folia is not supported on this version ({client_version})")
exit(0)

test_name_suffix = ""
if enable_folia:
test_name_suffix += "folia_"
test_name_suffix += f"{proxy_type}_{client_version}"

test_name = f"mmc_test_{test_name_suffix}"
test_env_dir = PARENT_DIR / "test_env" / test_name
makedirs(test_env_dir, exist_ok=True)

Expand Down Expand Up @@ -281,6 +301,13 @@ def save(data):
else:
world_version = "1.17.1"

if enable_folia:
server_type = "FOLIA"
else:
server_type = "PAPER"

logger.info(f"Selected server type: {server_type}")

for server_name in servers:
server_desc = {
'build': {
Expand All @@ -293,7 +320,8 @@ def save(data):
],
},
'environment': [
f'VERSION={server_version}'
f'VERSION={server_version}',
f'TYPE={server_type}',
],
'ports': [
]
Expand Down