Skip to content

Commit 1d821f8

Browse files
committed
Add order by
1 parent 45bf199 commit 1d821f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/jenkins/plugins/junit/storage/database/DatabaseTestResultStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public List<PackageResult> getAllPackageResults() {
151151
@Override
152152
public List<TrendTestResultSummary> getTrendTestResultSummary() {
153153
return query(connection -> {
154-
try (PreparedStatement statement = connection.prepareStatement("SELECT build, sum(case when errorDetails is not null then 1 else 0 end) as failCount, sum(case when skipped is not null then 1 else 0 end) as skipCount, sum(case when errorDetails is null and skipped is null then 1 else 0 end) as passCount FROM " + DatabaseTestResultStorage.CASE_RESULTS_TABLE + " WHERE job = ? group by build;")) {
154+
try (PreparedStatement statement = connection.prepareStatement("SELECT build, sum(case when errorDetails is not null then 1 else 0 end) as failCount, sum(case when skipped is not null then 1 else 0 end) as skipCount, sum(case when errorDetails is null and skipped is null then 1 else 0 end) as passCount FROM " + DatabaseTestResultStorage.CASE_RESULTS_TABLE + " WHERE job = ? group by build order by build;")) {
155155
statement.setString(1, job);
156156
try (ResultSet result = statement.executeQuery()) {
157157

@@ -174,7 +174,7 @@ public List<TrendTestResultSummary> getTrendTestResultSummary() {
174174
@Override
175175
public List<TestDurationResultSummary> getTestDurationResultSummary() {
176176
return query(connection -> {
177-
try (PreparedStatement statement = connection.prepareStatement("SELECT build, sum(duration) as duration FROM " + DatabaseTestResultStorage.CASE_RESULTS_TABLE + " WHERE job = ? group by build;")) {
177+
try (PreparedStatement statement = connection.prepareStatement("SELECT build, sum(duration) as duration FROM " + DatabaseTestResultStorage.CASE_RESULTS_TABLE + " WHERE job = ? group by build order by build;")) {
178178
statement.setString(1, job);
179179
try (ResultSet result = statement.executeQuery()) {
180180

0 commit comments

Comments
 (0)