diff --git a/.github/workflows/integ-tests-with-security.yml b/.github/workflows/integ-tests-with-security.yml index ca83b3c5cd5..8377974e7cc 100644 --- a/.github/workflows/integ-tests-with-security.yml +++ b/.github/workflows/integ-tests-with-security.yml @@ -60,7 +60,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ windows-latest, macos-13 ] + os: [ windows-latest, macos-14 ] java: [ 11, 17, 21 ] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 964cc63eb20..0c2ca73733e 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -105,11 +105,11 @@ jobs: matrix: entry: - { os: windows-latest, java: 11, os_build_args: -x doctest -PbuildPlatform=windows } - - { os: macos-13, java: 11} + - { os: macos-14, java: 11, os_build_args: -x doctest } - { os: windows-latest, java: 17, os_build_args: -x doctest -PbuildPlatform=windows } - - { os: macos-13, java: 17 } + - { os: macos-14, java: 17, os_build_args: -x doctest } - { os: windows-latest, java: 21, os_build_args: -x doctest -PbuildPlatform=windows } - - { os: macos-13, java: 21 } + - { os: macos-14, java: 21, os_build_args: -x doctest } runs-on: ${{ matrix.entry.os }} steps: diff --git a/async-query-core/build.gradle b/async-query-core/build.gradle index 37bf6748c9d..a019fb245ee 100644 --- a/async-query-core/build.gradle +++ b/async-query-core/build.gradle @@ -9,7 +9,7 @@ plugins { id 'jacoco' id 'antlr' id 'com.diffplug.spotless' version '6.22.0' - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' } repositories { diff --git a/core/src/test/java/org/opensearch/sql/expression/datetime/ExtractTest.java b/core/src/test/java/org/opensearch/sql/expression/datetime/ExtractTest.java index 74c28475664..fa7e1ea6c31 100644 --- a/core/src/test/java/org/opensearch/sql/expression/datetime/ExtractTest.java +++ b/core/src/test/java/org/opensearch/sql/expression/datetime/ExtractTest.java @@ -5,11 +5,12 @@ package org.opensearch.sql.expression.datetime; -import static java.time.temporal.ChronoField.ALIGNED_WEEK_OF_YEAR; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.opensearch.sql.data.type.ExprCoreType.LONG; import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Locale; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -96,15 +97,12 @@ public void testExtractDatePartWithTimeType() { datePartWithTimeArgQuery("DAY", timeInput, now.getDayOfMonth()); - // To avoid flaky test, skip the testing in December and January because the WEEK is ISO 8601 - // week-of-week-based-year which is considered to start on a Monday and week 1 is the first week - // with >3 days. it is possible for early-January dates to be part of the 52nd or 53rd week of - // the previous year, and for late-December dates to be part of the first week of the next year. - // For example, 2005-01-02 is part of the 53rd week of year 2004, while 2012-12-31 is part of - // the first week of 2013 - if (now.getMonthValue() != 1 && now.getMonthValue() != 12) { - datePartWithTimeArgQuery("WEEK", datetimeInput, now.get(ALIGNED_WEEK_OF_YEAR)); - } + // Use the same week-of-year calculation as the EXTRACT function (DateTimeFormatter "w" with + // Locale.ENGLISH) to avoid flaky mismatches. ALIGNED_WEEK_OF_YEAR uses simple arithmetic + // (dayOfYear-1)/7+1 which diverges from the locale-aware week numbering on many dates. + long expectedWeek = + Long.parseLong(DateTimeFormatter.ofPattern("w", Locale.ENGLISH).format(now.atStartOfDay())); + datePartWithTimeArgQuery("WEEK", datetimeInput, expectedWeek); datePartWithTimeArgQuery("MONTH", timeInput, now.getMonthValue());