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

deps: bump version.io.quarkus from 3.13.2 to 3.14.1 #1061

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion build/build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<version.ch.qos.logback>1.5.7</version.ch.qos.logback>
<version.org.apache.logging.log4j>2.23.1</version.org.apache.logging.log4j>
<version.ow2.asm>9.7</version.ow2.asm>
<version.io.quarkus>3.13.2</version.io.quarkus>
<version.io.quarkus>3.14.1</version.io.quarkus>
<version.org.apache.commons.compress>1.26.1</version.org.apache.commons.compress>
<version.org.apache.commons.math3>3.6.1</version.org.apache.commons.math3>
<version.org.apache.commons.text>1.11.0</version.org.apache.commons.text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;

/**
* During build time, this is translated into Timefold's Config classes.
*/
@ConfigRoot(name = "timefold.benchmark")
public class TimefoldBenchmarkBuildTimeConfig {
@ConfigMapping(prefix = "quarkus.timefold.benchmark")
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public interface TimefoldBenchmarkBuildTimeConfig {

String DEFAULT_SOLVER_BENCHMARK_CONFIG_URL = "solverBenchmarkConfig.xml";

public static final String DEFAULT_SOLVER_BENCHMARK_CONFIG_URL = "solverBenchmarkConfig.xml";
/**
* A classpath resource to read the benchmark configuration XML.
* Defaults to {@value DEFAULT_SOLVER_BENCHMARK_CONFIG_URL}.
* If this property isn't specified, that solverBenchmarkConfig.xml is optional.
*/
@ConfigItem
Optional<String> solverBenchmarkConfigXml;
Optional<String> solverBenchmarkConfigXml();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ai.timefold.solver.benchmark.quarkus.deployment;

import java.util.Optional;

import ai.timefold.solver.benchmark.config.PlannerBenchmarkConfig;
import ai.timefold.solver.benchmark.quarkus.TimefoldBenchmarkBeanProvider;
import ai.timefold.solver.benchmark.quarkus.TimefoldBenchmarkRecorder;
Expand Down Expand Up @@ -34,7 +36,7 @@ FeatureBuildItem feature() {

@BuildStep
HotDeploymentWatchedFileBuildItem watchSolverBenchmarkConfigXml() {
String solverBenchmarkConfigXML = timefoldBenchmarkBuildTimeConfig.solverBenchmarkConfigXml
String solverBenchmarkConfigXML = timefoldBenchmarkBuildTimeConfig.solverBenchmarkConfigXml()
.orElse(TimefoldBenchmarkBuildTimeConfig.DEFAULT_SOLVER_BENCHMARK_CONFIG_URL);
return new HotDeploymentWatchedFileBuildItem(solverBenchmarkConfigXML);
}
Expand All @@ -56,8 +58,9 @@ BenchmarkConfigBuildItem registerAdditionalBeans(BuildProducer<AdditionalBeanBui
}
PlannerBenchmarkConfig benchmarkConfig;
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (timefoldBenchmarkBuildTimeConfig.solverBenchmarkConfigXml.isPresent()) {
String solverBenchmarkConfigXML = timefoldBenchmarkBuildTimeConfig.solverBenchmarkConfigXml.get();
Optional<String> benchmarkConfigFile = timefoldBenchmarkBuildTimeConfig.solverBenchmarkConfigXml();
if (benchmarkConfigFile.isPresent()) {
String solverBenchmarkConfigXML = benchmarkConfigFile.get();
if (classLoader.getResource(solverBenchmarkConfigXML) == null) {
throw new ConfigurationException("Invalid quarkus.timefold.benchmark.solver-benchmark-config-xml property ("
+ solverBenchmarkConfigXML + "): that classpath resource does not exist.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ai.timefold.solver.benchmark.quarkus;

import java.util.stream.IntStream;

import jakarta.inject.Inject;

import ai.timefold.solver.benchmark.api.PlannerBenchmarkFactory;
import ai.timefold.solver.benchmark.quarkus.testdata.normal.constraints.TestdataQuarkusConstraintProvider;
import ai.timefold.solver.benchmark.quarkus.testdata.normal.domain.TestdataQuarkusEntity;
import ai.timefold.solver.benchmark.quarkus.testdata.normal.domain.TestdataQuarkusSolution;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;

class TimefoldBenchmarkProcessorBenchmarkCustomConfigTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
.overrideConfigKey("quarkus.timefold.benchmark.solver.termination.best-score-limit", "0")
.overrideConfigKey("quarkus.timefold.benchmark.solver-benchmark-config-xml", "customSolverBenchmarkConfig.xml")
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addAsResource("customSolverBenchmarkConfig.xml")
.addClasses(TestdataQuarkusEntity.class,
TestdataQuarkusSolution.class, TestdataQuarkusConstraintProvider.class));

@Inject
PlannerBenchmarkFactory benchmarkFactory;

@Test
@SuppressWarnings("java:S2699")
void benchmark() {
TestdataQuarkusSolution problem = new TestdataQuarkusSolution();
problem.setValueList(IntStream.range(1, 3)
.mapToObj(i -> "v" + i)
.toList());
problem.setEntityList(IntStream.range(1, 3)
.mapToObj(i -> new TestdataQuarkusEntity())
.toList());
benchmarkFactory.buildPlannerBenchmark(problem).benchmark();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<plannerBenchmark xmlns="https://timefold.ai/xsd/benchmark" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://timefold.ai/xsd/benchmark https://timefold.ai/xsd/benchmark/benchmark.xsd">

<solverBenchmarkBluePrint>
<solverBenchmarkBluePrintType>EVERY_LOCAL_SEARCH_TYPE</solverBenchmarkBluePrintType>
</solverBenchmarkBluePrint>
</plannerBenchmark>
Loading