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

Pull v1.1.0 into test #4

Merged
merged 28 commits into from
Nov 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f4b285d
Ignore `.class` files
Wrench56 Oct 25, 2024
fd51fad
Migrate to `yarn` version `4.5.1`
Wrench56 Oct 25, 2024
a437f60
Migrate to Tauri `v2`
Wrench56 Oct 25, 2024
3a2cdd8
Upgrade `fern` and `sysinfo` crates
Wrench56 Oct 26, 2024
f5591f4
Fix `Console.svelte` to use new Tauri `IPC` API
Wrench56 Oct 26, 2024
ed17fdc
Use monospace fonts to improve readability
Wrench56 Oct 26, 2024
520e6ad
Add `LogLevel` filters and autoscroll
Wrench56 Oct 26, 2024
46a3e95
Fix `on:scroll` event handling in `Console.svelte`
Wrench56 Oct 26, 2024
b6c9d97
Update `readme.md`
Wrench56 Oct 26, 2024
f8cab5a
Implement `handleKeepAlive()` in `SocketHandler.java`
Wrench56 Oct 26, 2024
1ef8452
Bump version to `1.1.0`
Wrench56 Oct 30, 2024
2edb3c2
Update `build.gradle` for `preprocessor`
Wrench56 Oct 30, 2024
e5a4d04
Fix `handleKeepAlive()` code in `lib`
Wrench56 Nov 4, 2024
52abd02
Fix payload documentation in `payload_factory.rs`
Wrench56 Nov 4, 2024
7ee633b
Add compression rate and bytes received to client status bar
Wrench56 Nov 5, 2024
77ddd2a
Fix CSS in `LogEntry.svelte`
Wrench56 Nov 5, 2024
ff110cb
Start `preprocessor` automatically on `compileJava`
Wrench56 Nov 5, 2024
696b7e6
Ignore `TurboTrace.init()` and `TurboTrace.handle()` in `TurboTraceLo…
Wrench56 Nov 5, 2024
c202afb
Fix `parseArguments()` in `LogEntry.java`
Wrench56 Nov 5, 2024
4701ec4
Fix `Cleanup.java` not restoring source directory
Wrench56 Nov 5, 2024
52227e5
Add `deleteDirectory()` in `Utils.java`
Wrench56 Nov 5, 2024
d757385
Save preprocessed code in `PreprocessorTask.java`
Wrench56 Nov 5, 2024
033dc6c
Update `PreprocessorPluginFunctionalTest.java`
Wrench56 Nov 5, 2024
2630aa1
Add `shadowJar` task in `build.gradle`
Wrench56 Nov 5, 2024
8c419e2
Bump `preprocessor` version
Wrench56 Nov 5, 2024
1db1497
Fix `LazyType` compression in `LogEntry.java`
Wrench56 Nov 5, 2024
ff3797d
Reset log entry IDs in `preprocess()` method
Wrench56 Nov 5, 2024
523a997
Add `example` project for demonstration purposes
Wrench56 Nov 5, 2024
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
Prev Previous commit
Next Next commit
Update PreprocessorPluginFunctionalTest.java
Wrench56 committed Nov 5, 2024
commit 033dc6cc3f44d3c9c5e36ba6173b57a8c2e66001
Original file line number Diff line number Diff line change
@@ -50,64 +50,58 @@ private boolean createFolders() {
@Test
@Order(1)
void canRunTask() throws IOException {
// Define paths
EXAMPLE_LOC = projectDir.toPath().resolve("src/");

/* Fail early on errors */
if (!createFolders())
assertTrue(false);
if (!Utils.copyDirectory(EXAMPLE_SRC, EXAMPLE_LOC))
assertTrue(false);
if (!createFolders()) {
throw new AssertionError("Failed to create required folders");
}
if (!Utils.copyDirectory(EXAMPLE_SRC, EXAMPLE_LOC)) {
throw new AssertionError("Failed to copy example source directory");
}

writeString(getSettingsFile(), "");
writeString(getBuildFile(), "plugins {" + " id('io.github.wrench56.turbotrace-preprocessor')" + "}");
writeString(getBuildFile(),
"plugins {" +
" id 'java'\n" +
" id 'io.github.wrench56.turbotrace-preprocessor'\n" +
"}");

GradleRunner runner = GradleRunner.create()
.withPluginClasspath()
.withArguments("compileJava")
.withProjectDir(projectDir)
.forwardOutput();

GradleRunner runner = GradleRunner.create();
runner.forwardOutput();
runner.withPluginClasspath();
runner.withArguments("preprocess");
runner.withProjectDir(projectDir);
BuildResult result = runner.build();

/* Preprocessor starts */
assertTrue(result.getOutput().contains("Starting TurboTrace preprocessor..."));
System.out.println(result.getOutput());
assertTrue(result.getOutput().contains("Preprocessing with TurboTrace..."));
}

@Test
@Order(2)
void logtypesCreated() {
/* JSON logtypes created */
assertTrue(Files.exists(EXAMPLE_LOC.resolve("logtypes.json")));
assertTrue(Files.exists(EXAMPLE_LOC.resolve("../logtypes.json")));
}

@Test
@Order(3)
void logtypesCorrect() throws IOException {
assertTrue(
Utils.areFilesEqual(
EXAMPLE_LOC.resolve("logtypes.json").toFile(), EXPECTED_LOGTYPES));
EXAMPLE_LOC.resolve("../logtypes.json").toFile(), EXPECTED_LOGTYPES));
}

@Test
@Order(4)
void canRunCleanup() {
GradleRunner runner = GradleRunner.create();
runner.forwardOutput();
runner.withPluginClasspath();
runner.withArguments("cleanup");
runner.withProjectDir(projectDir);
BuildResult result = runner.build();

assertTrue(result.getOutput().contains("Starting TurboTrace cleanup..."));
}

@Test
@Order(5)
void tempDeleted() {
assertTrue(Files.exists(projectDir.toPath().resolve(TEMP_DIR)));
}

@Test
@Order(6)
@Order(5)
void srcRestored() {
assertTrue(Utils.areDirectoriesEqual(EXAMPLE_SRC.resolve("example/pkg").toFile(), EXAMPLE_LOC.toFile()));
}