Skip to content

Test Linux Stability #195

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,23 @@ jobs:
DEFAULT_BRANCH: main
VALIDATE_MARKDOWN: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

integration-test-linux:
runs-on: ubuntu-latest
env:
SPARK_REMOTE: "sc://localhost:15003"
services:
spark:
image: apache/spark:4.0.0
env:
SPARK_NO_DAEMONIZE: 1
SPARK_USER: 185
ports:
- 15003:15002
options: --entrypoint /opt/spark/sbin/start-connect-server.sh
steps:
- uses: actions/checkout@v4
- name: Build
run: |
docker run swift:6.1 uname -a
docker run --add-host=host.docker.internal:host-gateway -v $PWD:/spark -w /spark -e SPARK_REMOTE='sc://host.docker.internal:15003' swift:6.1 swift test --no-parallel -c release
2 changes: 0 additions & 2 deletions Tests/SparkConnectTests/CatalogTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Testing
/// A test suite for `Catalog`
@Suite(.serialized)
struct CatalogTests {
#if !os(Linux)
@Test
func currentCatalog() async throws {
let spark = try await SparkSession.builder.getOrCreate()
Expand Down Expand Up @@ -306,7 +305,6 @@ struct CatalogTests {
#expect(try await spark.catalog.dropGlobalTempView("invalid view name") == false)
await spark.stop()
}
#endif

@Test
func cacheTable() async throws {
Expand Down
2 changes: 0 additions & 2 deletions Tests/SparkConnectTests/DataFrameInternalTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Testing
@Suite(.serialized)
struct DataFrameInternalTests {

#if !os(Linux)
@Test
func showString() async throws {
let spark = try await SparkSession.builder.getOrCreate()
Expand Down Expand Up @@ -83,5 +82,4 @@ struct DataFrameInternalTests {
""")
await spark.stop()
}
#endif
}
4 changes: 0 additions & 4 deletions Tests/SparkConnectTests/DataFrameTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ struct DataFrameTests {
await spark.stop()
}

#if !os(Linux)
@Test
func sort() async throws {
let spark = try await SparkSession.builder.getOrCreate()
Expand All @@ -360,7 +359,6 @@ struct DataFrameTests {
#expect(try await spark.range(10, 0, -1).orderBy("id").collect() == expected)
await spark.stop()
}
#endif

@Test
func table() async throws {
Expand All @@ -376,7 +374,6 @@ struct DataFrameTests {
await spark.stop()
}

#if !os(Linux)
@Test
func collect() async throws {
let spark = try await SparkSession.builder.getOrCreate()
Expand Down Expand Up @@ -912,7 +909,6 @@ struct DataFrameTests {
#expect(try await df.collect() == expected)
await spark.stop()
}
#endif

@Test
func storageLevel() async throws {
Expand Down
14 changes: 6 additions & 8 deletions Tests/SparkConnectTests/IcebergTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ struct IcebergTests {
WHEN NOT MATCHED BY SOURCE THEN UPDATE SET data = 'invalid'
"""
).count()
#if !os(Linux)
let expected = [
Row(2, "updated"),
Row(3, "invalid"),
Row(4, "new"),
]
#expect(try await spark.table(t2).collect() == expected)
#endif
let expected = [
Row(2, "updated"),
Row(3, "invalid"),
Row(4, "new"),
]
#expect(try await spark.table(t2).collect() == expected)
})
await spark.stop()
}
Expand Down
2 changes: 0 additions & 2 deletions Tests/SparkConnectTests/SQLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ struct SQLTests {
"variant.sql",
]

#if !os(Linux)
@Test
func runAll() async throws {
let spark = try await SparkSession.builder.getOrCreate()
Expand Down Expand Up @@ -120,5 +119,4 @@ struct SQLTests {
}
await spark.stop()
}
#endif
}
4 changes: 0 additions & 4 deletions Tests/SparkConnectTests/SparkSessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ struct SparkSessionTests {
await spark.stop()
}

#if !os(Linux)
@Test
func sql() async throws {
await SparkSession.builder.clear()
Expand Down Expand Up @@ -196,7 +195,6 @@ struct SparkSessionTests {
}
await spark.stop()
}
#endif

@Test
func table() async throws {
Expand All @@ -215,10 +213,8 @@ struct SparkSessionTests {
await SparkSession.builder.clear()
let spark = try await SparkSession.builder.getOrCreate()
#expect(try await spark.time(spark.range(1000).count) == 1000)
#if !os(Linux)
#expect(try await spark.time(spark.range(1).collect) == [Row(0)])
try await spark.time(spark.range(10).show)
#endif
await spark.stop()
}

Expand Down
Loading