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

fix: fix tes which throw validation exception #202

Merged
merged 1 commit into from
Jan 10, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.kestra.plugin.scripts.exec.scripts.models.ScriptOutput;
import io.kestra.core.junit.annotations.KestraTest;
import jakarta.inject.Inject;
import jakarta.validation.ConstraintViolationException;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -26,8 +27,7 @@
import java.util.stream.Stream;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.*;
import static org.junit.jupiter.api.Assertions.assertThrows;

@KestraTest
Expand Down Expand Up @@ -183,9 +183,8 @@ void emptyScript(RunnerType runner, DockerOptions dockerOptions) throws Exceptio
.build();

RunContext runContext = TestsUtils.mockRunContext(runContextFactory, python, ImmutableMap.of());
ScriptOutput run = python.run(runContext);

assertThat(run.getExitCode(), is(0));
ConstraintViolationException exception = assertThrows(ConstraintViolationException.class, () -> python.run(runContext));
assertThat(exception.getMessage(), containsString("script: must not be empty"));
}

@ParameterizedTest
Expand Down
Loading