-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using Guava RateLimiter as the gametests run ticks faster, and the RateLimiter uses the system clock so RS wouldn't keep up with the faster tick rate.
- Loading branch information
1 parent
be403ac
commit e423f42
Showing
20 changed files
with
216 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,7 @@ on: | |
types: [ opened, synchronize, reopened ] | ||
jobs: | ||
build: | ||
uses: refinedmods/refinedarchitect/.github/workflows/[email protected] | ||
uses: refinedmods/refinedarchitect/.github/workflows/[email protected] | ||
with: | ||
gametests: true | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...m-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.refinedmods.refinedstorage2.platform.forge; | ||
|
||
import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; | ||
import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; | ||
import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; | ||
import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.core.Direction; | ||
import net.minecraft.gametest.framework.GameTest; | ||
import net.minecraft.gametest.framework.GameTestHelper; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.neoforged.neoforge.gametest.GameTestHolder; | ||
import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; | ||
|
||
import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.DIRT; | ||
import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; | ||
import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.itemIsInserted; | ||
import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; | ||
import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageMustContainExactly; | ||
import static net.minecraft.core.BlockPos.ZERO; | ||
|
||
@GameTestHolder(IdentifierUtil.MOD_ID) | ||
@PrefixGameTestTemplate(false) | ||
public final class ConstructorTest { | ||
private ConstructorTest() { | ||
} | ||
|
||
@GameTest(template = "empty_15x15") | ||
public static void shouldPlaceBlock(final GameTestHelper helper) { | ||
// Arrange | ||
helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); | ||
helper.setBlock(ZERO.above().above(), RSBLOCKS.getConstructor().getDefault().rotated(Direction.EAST)); | ||
helper.setBlock( | ||
ZERO.above().above().above(), | ||
RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K) | ||
); | ||
|
||
final var seq = helper.startSequence(); | ||
seq.thenWaitUntil(itemIsInserted(helper, ZERO.above().above(), DIRT, 10)); | ||
|
||
// Act | ||
requireBlockEntity(helper, ZERO.above().above(), ConstructorBlockEntity.class).setFilters(List.of(DIRT)); | ||
|
||
// Assert | ||
seq.thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, ZERO.above().above().east())) | ||
.thenWaitUntil(storageMustContainExactly(helper, ZERO.above().above(), new ResourceAmount(DIRT, 9))) | ||
.thenSucceed(); | ||
} | ||
} |
Oops, something went wrong.