-
Notifications
You must be signed in to change notification settings - Fork 7
Fix memory usage and chunkcache #18
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
Draft
Trainboy15
wants to merge
39
commits into
TuffNetwork:main
Choose a base branch
from
Trainboy15:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d6b2c05
Optomize memory usage and cache usage
Trainboy15 6952825
Update version from 1.0.1-beta to 1.0.0-patch
Trainboy15 743151f
Remove gradle temp
Trainboy15 0a82893
Refactor Gradle CI workflow for improved structure
Trainboy15 f499758
Update build artifact
invalid-email-address ecedd55
Remove deployment step from gradle.yml
Trainboy15 35d2da4
Update build artifact
invalid-email-address 52ea90c
Fix config
Trainboy15 bcfb2b9
Add NPE catches
Trainboy15 a632e1f
Merge pull request #1 from Trainboy15/testing
Trainboy15 e6d7ee9
Update build artifact
invalid-email-address cd5988f
Tab indentation
Trainboy15 5b1cae7
Update build artifact
invalid-email-address abb5169
Clean up whitespace
UplandJacob ab3107e
Update build artifact
invalid-email-address b64bd0d
Fix IllegalArgumentException
Trainboy15 d5d0b4c
Update build artifact
invalid-email-address d7da218
Add update check
Trainboy15 c327678
Fixed update checker
Trainboy15 854f750
Update build artifact
invalid-email-address 951fab7
Add testing... IDK if it will work
Trainboy15 ddd22ad
Change to java 17
Trainboy15 c97efac
Fix dependencies?
Trainboy15 8005e8f
FR this time trust
Trainboy15 509cf1b
Update build artifact
invalid-email-address 2967f45
Refactor GitHub Actions workflow for tests
Trainboy15 21ac55b
Update build artifact
invalid-email-address acf5f53
maybe fix memory issuses
Trainboy15 b2a43a6
Update build artifact
invalid-email-address 707b3cf
Impement @UplandJacob's changes
Trainboy15 844dbd9
Update build artifact
invalid-email-address 9cc2862
undo some things for now
UplandJacob c23163c
Update build artifact
invalid-email-address e5c2f5f
oop more
UplandJacob fe9c89c
Update build artifact
invalid-email-address 6427b1e
Remove unnecessary line from gradle.yml
UplandJacob fb46122
Update build artifact
invalid-email-address 6a48b75
Implement some of @UplandJacob's changes
Trainboy15 0c404b3
Update build artifact
invalid-email-address File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,36 @@ | ||
| name: Build & Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "**" ] | ||
| pull_request: | ||
| branches: [ "**" ] | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Unit Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Java 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Run tests | ||
| run: ./gradlew test --no-daemon | ||
|
|
||
| - name: Upload test reports | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-reports | ||
| path: build/reports/tests/test/ |
This file contains hidden or 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
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you've made this PR from your |
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,66 @@ | ||
| package tf.tuff; | ||
|
|
||
| import be.seeseemelk.mockbukkit.MockBukkit; | ||
| import be.seeseemelk.mockbukkit.ServerMock; | ||
| import be.seeseemelk.mockbukkit.entity.PlayerMock; | ||
| import org.junit.jupiter.api.*; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| class TuffXTest { | ||
|
|
||
| private static ServerMock server; | ||
| private static TuffX plugin; | ||
|
|
||
| @BeforeEach | ||
| void setUp() { | ||
| server = MockBukkit.mock(); | ||
| plugin = MockBukkit.load(TuffX.class); | ||
| } | ||
|
|
||
| @AfterEach | ||
| void tearDown() { | ||
| MockBukkit.unmock(); | ||
| } | ||
|
|
||
| @Test | ||
| void pluginEnablesSuccessfully() { | ||
| assertTrue(plugin.isEnabled(), "Plugin should be enabled after load"); | ||
| } | ||
|
|
||
| @Test | ||
| void latestVersionIsNullOnStartup() { | ||
| assertNull(plugin.latestAvailableVersion, | ||
| "No update should be detected synchronously at startup"); | ||
| } | ||
|
|
||
| @Test | ||
| void reloadDoesNotThrow() { | ||
| assertDoesNotThrow(() -> plugin.reloadTuffX(), | ||
| "reloadTuffX() should not throw"); | ||
| } | ||
|
|
||
| @Test | ||
| void opReceivesUpdateMessageWhenUpdateAvailable() { | ||
| plugin.latestAvailableVersion = "2.0.0"; | ||
|
|
||
| PlayerMock player = server.addPlayer(); | ||
| player.setOp(true); | ||
| player.assertNoMoreSaid(); | ||
|
|
||
| player.disconnect(); | ||
| server.addPlayer(player.getName()); | ||
|
|
||
| player.assertSaid("§e[TuffX] §fA new version is available: §a2.0.0 §f(running §c1.0.0-patch§f)"); | ||
| } | ||
|
|
||
| @Test | ||
| void nonOpDoesNotReceiveUpdateMessage() { | ||
| plugin.latestAvailableVersion = "2.0.0"; | ||
|
|
||
| PlayerMock player = server.addPlayer(); | ||
| player.setOp(false); | ||
|
|
||
| player.assertNoMoreSaid(); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.