Skip to content

Commit 7f6dd9b

Browse files
authored
Fix build by updating broken tests and freezing MarkupSafe version (#10468)
* freeze version * fix test * Fix another test
1 parent b26bdf7 commit 7f6dd9b

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

airbyte-integrations/bases/debezium/src/test/java/io/airbyte/integrations/debezium/internals/DebeziumConverterUtilsTest.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DebeziumConverterUtilsTest {
2222
@Test
2323
public void convertDefaultValueTest() {
2424

25-
RelationalColumn relationalColumn = mock(RelationalColumn.class);
25+
final RelationalColumn relationalColumn = mock(RelationalColumn.class);
2626

2727
when(relationalColumn.isOptional()).thenReturn(true);
2828
Object actualColumnDefaultValue = DebeziumConverterUtils.convertDefaultValue(relationalColumn);
@@ -35,67 +35,67 @@ public void convertDefaultValueTest() {
3535

3636
when(relationalColumn.isOptional()).thenReturn(false);
3737
when(relationalColumn.hasDefaultValue()).thenReturn(true);
38-
String expectedColumnDefaultValue = "default value";
38+
final String expectedColumnDefaultValue = "default value";
3939
when(relationalColumn.defaultValue()).thenReturn(expectedColumnDefaultValue);
4040
actualColumnDefaultValue = DebeziumConverterUtils.convertDefaultValue(relationalColumn);
4141
Assertions.assertEquals(actualColumnDefaultValue, expectedColumnDefaultValue);
4242
}
4343

4444
@Test
4545
public void convertLocalDate() {
46-
LocalDate localDate = LocalDate.of(2021, 1, 1);
46+
final LocalDate localDate = LocalDate.of(2021, 1, 1);
4747

48-
String actual = DebeziumConverterUtils.convertDate(localDate);
48+
final String actual = DebeziumConverterUtils.convertDate(localDate);
4949
Assertions.assertEquals("2021-01-01T00:00:00Z", actual);
5050
}
5151

5252
@Test
5353
public void convertTLocalTime() {
54-
LocalTime localTime = LocalTime.of(8, 1, 1);
55-
String actual = DebeziumConverterUtils.convertDate(localTime);
54+
final LocalTime localTime = LocalTime.of(8, 1, 1);
55+
final String actual = DebeziumConverterUtils.convertDate(localTime);
5656
Assertions.assertEquals("08:01:01", actual);
5757
}
5858

5959
@Test
6060
public void convertLocalDateTime() {
61-
LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
61+
final LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
6262

63-
String actual = DebeziumConverterUtils.convertDate(localDateTime);
63+
final String actual = DebeziumConverterUtils.convertDate(localDateTime);
6464
Assertions.assertEquals("2021-01-01T08:01:01Z", actual);
6565
}
6666

6767
@Test
6868
@Disabled
6969
public void convertDuration() {
70-
Duration duration = Duration.ofHours(100_000);
70+
final Duration duration = Duration.ofHours(100_000);
7171

72-
String actual = DebeziumConverterUtils.convertDate(duration);
72+
final String actual = DebeziumConverterUtils.convertDate(duration);
7373
Assertions.assertEquals("1981-05-29T20:00:00Z", actual);
7474
}
7575

7676
@Test
7777
public void convertTimestamp() {
78-
LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
79-
Timestamp timestamp = Timestamp.valueOf(localDateTime);
78+
final LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
79+
final Timestamp timestamp = Timestamp.valueOf(localDateTime);
8080

81-
String actual = DebeziumConverterUtils.convertDate(timestamp);
82-
Assertions.assertEquals("2021-01-01T08:01:01Z", actual);
81+
final String actual = DebeziumConverterUtils.convertDate(timestamp);
82+
Assertions.assertEquals("2021-01-01T08:01:01.000000Z", actual);
8383
}
8484

8585
@Test
8686
@Disabled
8787
public void convertNumber() {
88-
Number number = 100_000;
88+
final Number number = 100_000;
8989

90-
String actual = DebeziumConverterUtils.convertDate(number);
90+
final String actual = DebeziumConverterUtils.convertDate(number);
9191
Assertions.assertEquals("1970-01-01T03:01:40Z", actual);
9292
}
9393

9494
@Test
9595
public void convertStringDateFormat() {
96-
String stringValue = "2021-01-01T00:00:00Z";
96+
final String stringValue = "2021-01-01T00:00:00Z";
9797

98-
String actual = DebeziumConverterUtils.convertDate(stringValue);
98+
final String actual = DebeziumConverterUtils.convertDate(stringValue);
9999
Assertions.assertEquals("2021-01-01T00:00:00Z", actual);
100100
}
101101

airbyte-integrations/connectors/destination-jdbc/src/test/java/io/airbyte/integrations/destination/jdbc/SqlOperationsUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ void testInsertRawRecordsInSingleQuery() throws SQLException {
9393
.put(JavaBaseConstants.COLUMN_NAME_AB_ID, RECORD1_UUID)
9494
.put(JavaBaseConstants.COLUMN_NAME_DATA, records.get(0).getData())
9595
.put(JavaBaseConstants.COLUMN_NAME_EMITTED_AT, DataTypeUtils
96-
.toISO8601String(records.get(0).getEmittedAt()))
96+
.toISO8601StringWithMicroseconds(Instant.ofEpochMilli(records.get(0).getEmittedAt())))
9797
.build()),
9898
Jsons.jsonNode(ImmutableMap.builder()
9999
.put(JavaBaseConstants.COLUMN_NAME_AB_ID, RECORD2_UUID)
100100
.put(JavaBaseConstants.COLUMN_NAME_DATA, records.get(1).getData())
101101
.put(JavaBaseConstants.COLUMN_NAME_EMITTED_AT, DataTypeUtils
102-
.toISO8601String(records.get(1).getEmittedAt()))
102+
.toISO8601StringWithMicroseconds(Instant.ofEpochMilli(records.get(1).getEmittedAt())))
103103
.build()));
104104

105105
actualRecords.forEach(

tools/code-generator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM python:3.10-slim
22
# pin black to version 21.12b0 because its latest version
33
# 22.1.0 seems incompatible with datamodel-code-generator
4-
RUN pip install black==21.12b0 datamodel-code-generator==0.10.1
4+
RUN pip install MarkupSafe==2.0.1 black==21.12b0 datamodel-code-generator==0.10.1
55
ENTRYPOINT ["datamodel-codegen"]
66

77
LABEL io.airbyte.version=dev

0 commit comments

Comments
 (0)