Skip to content

Commit

Permalink
Merge pull request #6167 from SkriptLang/dev/patch
Browse files Browse the repository at this point in the history
Merge `dev/patch` into `master`
  • Loading branch information
Moderocky committed Nov 1, 2023
2 parents 8c7fec0 + 0e6be2d commit 7178dc4
Show file tree
Hide file tree
Showing 51 changed files with 1,004 additions and 506 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -223,3 +223,6 @@ gradle-app.setting
# TODO remove this in the future after some time since https://github.com/SkriptLang/Skript/pull/4979
# This ensures developers don't upload their old existing test_runners/ folder.
test_runners/

## Mac MetaData
**/.DS_Store
6 changes: 3 additions & 3 deletions build.gradle
Expand Up @@ -27,7 +27,7 @@ allprojects {
dependencies {
shadow group: 'io.papermc', name: 'paperlib', version: '1.0.8'
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.0'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.1'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.2-R0.1-SNAPSHOT'
implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.700'
Expand Down Expand Up @@ -150,7 +150,7 @@ license {
}

task releaseJavadoc(type: Javadoc) {
title = project.property('version')
title = project.name + ' ' + project.property('version')
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options.encoding = 'UTF-8'
Expand Down Expand Up @@ -223,7 +223,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
main = 'ch.njol.skript.test.platform.PlatformMain'
args = [
'build/test_runners',
junit ? 'src/test/skript/tests/junit' : 'src/test/skript/tests',
junit ? 'src/test/skript/junit' : 'src/test/skript/tests',
'src/test/resources/runner_data',
environments,
modifiers.contains(Modifiers.DEV_MODE),
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
@@ -1,6 +1,9 @@
# Ensure encoding is consistent across systems
org.gradle.jvmargs=-Dfile.encoding=UTF-8

groupid=ch.njol
name=skript
version=2.7.1
version=2.7.2
jarName=Skript.jar
testEnv=java17/paper-1.20.2
testEnvJavaVersion=17
2 changes: 1 addition & 1 deletion skript-aliases
Submodule skript-aliases updated 1 files
+3 −1 decoration.sk
9 changes: 5 additions & 4 deletions src/main/java/ch/njol/skript/Skript.java
Expand Up @@ -591,6 +591,8 @@ public void run() {
tainted = true;
try {
getAddonInstance().loadClasses("ch.njol.skript.test.runner");
if (TestMode.JUNIT)
getAddonInstance().loadClasses("org.skriptlang.skript.test.junit.registration");
} catch (IOException e) {
Skript.exception("Failed to load testing environment.");
Bukkit.getServer().shutdown();
Expand Down Expand Up @@ -684,7 +686,6 @@ protected void afterErrors() {
TestTracker.testFailed("exception was thrown during execution");
}
if (TestMode.JUNIT) {
SkriptLogger.setVerbosity(Verbosity.DEBUG);
info("Running all JUnit tests...");
long milliseconds = 0, tests = 0, fails = 0, ignored = 0, size = 0;
try {
Expand Down Expand Up @@ -712,7 +713,7 @@ protected void afterErrors() {
// If JUnit failures are present, add them to the TestTracker.
junit.getFailures().forEach(failure -> {
String message = failure.getMessage() == null ? "" : " " + failure.getMessage();
TestTracker.testFailed("'" + test + "': " + message);
TestTracker.JUnitTestFailed(test, message);
Skript.exception(failure.getException(), "JUnit test '" + failure.getTestHeader() + " failed.");
});
SkriptJUnitTest.clearJUnitTest();
Expand All @@ -734,7 +735,7 @@ protected void afterErrors() {
// Delay server shutdown to stop the server from crashing because the current tick takes a long time due to all the tests
Bukkit.getScheduler().runTaskLater(Skript.this, () -> {
if (TestMode.JUNIT && !EffObjectives.isJUnitComplete())
TestTracker.testFailed(EffObjectives.getFailedObjectivesString());
EffObjectives.fail();

info("Collecting results to " + TestMode.RESULTS_FILE);
String results = new Gson().toJson(TestTracker.collectResults());
Expand Down Expand Up @@ -1261,7 +1262,7 @@ public static boolean isAcceptRegistrations() {
}

public static void checkAcceptRegistrations() {
if (!isAcceptRegistrations())
if (!isAcceptRegistrations() && !Skript.testing())
throw new SkriptAPIException("Registration can only be done during plugin initialization");
}

Expand Down

0 comments on commit 7178dc4

Please sign in to comment.