Skip to content

Commit 31e1319

Browse files
committed
Checkpoint before new AI session.
Deletes the one problematic test and starts on a proper code coverage journey instead. Two temp plan docs included.
1 parent c998e33 commit 31e1319

File tree

5 files changed

+85
-136
lines changed

5 files changed

+85
-136
lines changed

config/gradle/common.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,21 @@ tasks.javadoc {
4343
// TODO: Temporary until javadoc has been fixed for Java 8 everywhere
4444
failOnError = false
4545
}
46+
47+
apply plugin: 'jacoco'
48+
49+
jacoco {
50+
toolVersion = "0.8.13"
51+
}
52+
53+
test {
54+
finalizedBy jacocoTestReport
55+
}
56+
57+
jacocoTestReport {
58+
dependsOn test
59+
reports {
60+
xml.required = true
61+
html.required = true
62+
}
63+
}

engine-tests/build.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,19 @@ idea {
164164
isDownloadSources = true
165165
}
166166
}
167+
168+
tasks.named<org.gradle.testing.jacoco.tasks.JacocoReport>("jacocoTestReport") {
169+
// Cross-module support: The tests in this module (:engine-tests) exercise code located in the :engine module.
170+
// By default, JaCoCo only looks at sources in the current project. We must explicitly add the :engine
171+
// main source set and output classes so that the coverage report includes the actual engine code.
172+
val engineProject = project(":engine")
173+
val sourceSets = engineProject.extensions.getByType(SourceSetContainer::class)
174+
val mainSourceSet = sourceSets.getByName("main")
175+
176+
additionalSourceDirs.from(mainSourceSet.allSource)
177+
additionalClassDirs.from(mainSourceSet.output)
178+
reports {
179+
xml.required.set(true)
180+
html.required.set(true)
181+
}
182+
}

engine-tests/src/test/java/org/terasology/metatesting/NetworkEventTest.java

Lines changed: 0 additions & 136 deletions
This file was deleted.

future_tasks.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Future Tasks Roadmap
2+
3+
## 1. MTE Module Synchronization
4+
* **Context**: Changes were made to `EntitySystemSetupUtil` and `NetworkEventSystemDecorator` in the `engine` to fix network event propagation in tests.
5+
* **Task**: Propagate these changes to the standalone `ModuleTestingEnvironment` module (located in `modules/ModuleTestingEnvironment`).
6+
* Compare `engine` implementation with `ModuleTestingEnvironment` implementation.
7+
* Apply the `NetworkEventSystemDecorator` wrapping logic to the MTE module's initialization code.
8+
* **Verification**: Run tests within the `ModuleTestingEnvironment` module to ensure no regressions and that network events propagate correctly there as well.
9+
10+
## 2. Record & Replay System
11+
* **Context**: The user mentioned diving into the record & replay system after MTE work is stabilized.
12+
* **Task**: Investigate the current state of the Record & Replay system.
13+
* Assess if the recent `NetworkEventSystemDecorator` changes impact recording/replaying of events.
14+
* Create/Run tests specifically for Record & Replay scenarios.
15+
16+
## 3. Networking Coverage Expansion
17+
* **Context**: JaCoCo analysis identified gaps in `org.terasology.engine.network`.
18+
* **Task**: Implement tests for:
19+
* `ServerInfoService`
20+
* `PingService` / `PingComponent`
21+
* `ServerPingSystem` / `ClientPingSystem`

testing_plan.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Testing Plan & Session Summary
2+
3+
## Recent Work Completed
4+
1. **Fixed Network Event Propagation**:
5+
* Diagnosed and fixed `UncheckedTimeoutException` in `MTETwoClientChatTest`.
6+
* Root cause: `EventSystemImpl` was not being wrapped with `NetworkEventSystemDecorator` in the MTE initialization, causing network events to be treated as local.
7+
* Fix: Updated `EntitySystemSetupUtil.java` to use `NetworkEventSystemDecorator` when networking is enabled.
8+
* Verified: `MTETwoClientChatTest` now passes.
9+
10+
2. **Code Coverage Analysis (JaCoCo)**:
11+
* Integrated JaCoCo into `common.gradle` and `engine-tests/build.gradle.kts` (with cross-module support).
12+
* Analyzed `org.terasology.engine.network` package.
13+
* **Findings**: ~50% instruction coverage.
14+
* For Jenkins enable JaCoCo somehow but only store the XML report (past issues led to immense JaCoCo storage usage)
15+
16+
## Coverage Gaps & Priorities
17+
The following areas in `org.terasology.engine.network` have significant coverage gaps and should be prioritized in the next testing round:
18+
19+
### High Priority (0% Coverage)
20+
* **`ServerInfoService`** (142 missed instructions): Completely untested. Critical for server discovery/info.
21+
* **`PingService`** (41 missed instructions): Untested.
22+
* **`PingComponent`** (27 missed instructions): Untested.
23+
* **`ClientPingSystem`** (18 missed instructions): Untested.
24+
25+
### Medium Priority (Partial Coverage)
26+
* **`ServerPingSystem`** (134 missed instructions): Partially covered, but likely missing edge cases or specific scenarios.
27+
28+
## Strategy for Next Session
29+
1. **Targeted Unit Tests**: Create a new test class (e.g., `ServerInfoServiceTest`) to specifically target `ServerInfoService`.
30+
2. **Integration Tests**: Expand `NetworkEventPropagationTest` or create a new MTE test to cover Ping functionality (`PingService`, `ServerPingSystem`, `ClientPingSystem`).

0 commit comments

Comments
 (0)