Skip to content

Test that importing never writes to plugins/SetHomes/ #57

Description

@milanmalhotra

Part of #41, and the one acceptance criterion there that the rehearsal proved by hand and left owed.

The guarantee the whole migration rests on is that v2 never writes, renames or deletes anything under plugins/SetHomes/. Put the old jar back and the server is exactly as it was. That is what makes the upgrade reversible, and it is the reason the rename to name: SetHomes was rejected.

It held in the 2026-08-16 rehearsal: plugins/SetHomes/ was byte-for-byte identical to its pre-import checksums after a full confirm import and a play session. Nothing in the suite asserts it, so a future change to the importer can quietly break it.

What to build

A MockBukkit test alongside ImportHomesTest that hashes every file under a Set Homes v1 fixture directory, runs the import, and asserts nothing moved. Cover the dry run and confirm separately.

Assert on the set of file paths as well as the contents, so a new file appearing under the fixture directory fails rather than passing unnoticed.

Give the fixture the cases that make the importer work hardest, so the test is not proving read-only behavior on a trivial file: a home in a world that no longer exists, a case-only duplicate name, an unnamed home, and a player the server has never seen.

Acceptance criteria

  • A dry run leaves every file under the v1 fixture byte-identical.
  • A confirm import leaves every file under the v1 fixture byte-identical.
  • Neither adds a file to, nor removes one from, the fixture directory.
  • Verified by breaking it: make the importer write a file under the fixture, confirm the test fails, then restore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions