Skip to content

Commit

Permalink
test: fail earlier when explicitly-named test dependencies are not found
Browse files Browse the repository at this point in the history
  • Loading branch information
keturn committed May 19, 2022
1 parent 1991556 commit b5b42ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class TestingStateHeadlessSetup extends StateHeadlessSetup {

private final Collection<String> dependencies;
private final SimpleUri worldGeneratorUri;

{
strictModuleRequirements = true;
}

public TestingStateHeadlessSetup(Collection<String> dependencies, String worldGeneratorUri) {
this.dependencies = dependencies;
this.worldGeneratorUri = new SimpleUri(worldGeneratorUri);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation
// Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.core.subsystem.headless.mode;

Expand Down Expand Up @@ -33,6 +33,8 @@ public class StateHeadlessSetup extends AbstractState {

private static final Logger logger = LoggerFactory.getLogger(StateHeadlessSetup.class);

protected boolean strictModuleRequirements;

public StateHeadlessSetup() {
}

Expand Down Expand Up @@ -68,6 +70,8 @@ public GameManifest createGameManifest() {
Module module = moduleManager.getRegistry().getLatestModuleVersion(moduleName);
if (module != null) {
gameManifest.addModule(module.getId(), module.getVersion());
} else if (strictModuleRequirements) {
throw new RuntimeException("ModuleRegistry has no latest version for module " + moduleName);
} else {
logger.warn("ModuleRegistry has no latest version for module {}", moduleName);
}
Expand Down

0 comments on commit b5b42ae

Please sign in to comment.