Skip to content

Commit bdb1fe0

Browse files
authored
Merge pull request #1253 from microsoft/enhancement-ci-windows-test-integration
[ci] Support Integration Tests for Windows
2 parents ba498f1 + b558699 commit bdb1fe0

File tree

8 files changed

+58
-17
lines changed

8 files changed

+58
-17
lines changed

.github/workflows/catloop.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
--branch origin/$branch_name \
6262
--libos $LIBOS \
6363
--debug \
64-
--test-unit --test-system all --delay 2 --enable-nfs \
64+
--test-unit --test-integration --test-system all \
65+
--delay 2 --enable-nfs \
6566
--server-addr $SERVER_ADDR \
6667
--client-addr $CLIENT_ADDR
6768
- name: Archive Logs
@@ -109,7 +110,8 @@ jobs:
109110
--repository demikernel \
110111
--branch origin/$branch_name \
111112
--libos $LIBOS \
112-
--test-unit --test-system all --delay 2 --enable-nfs \
113+
--test-unit --test-integration --test-system all \
114+
--delay 2 --enable-nfs \
113115
--server-addr $SERVER_ADDR \
114116
--client-addr $CLIENT_ADDR \
115117
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \

.github/workflows/catmem.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
--branch origin/$branch_name \
6262
--libos $LIBOS \
6363
--debug \
64-
--test-unit --test-system all --delay 2 --enable-nfs \
64+
--test-unit --test-integration --test-system all \
65+
--delay 2 --enable-nfs \
6566
--server-addr $SERVER_ADDR \
6667
--client-addr $CLIENT_ADDR
6768
- name: Archive Logs
@@ -109,7 +110,8 @@ jobs:
109110
--repository demikernel \
110111
--branch origin/$branch_name \
111112
--libos $LIBOS \
112-
--test-unit --test-system all --delay 2 --enable-nfs \
113+
--test-unit --test-integration --test-system all \
114+
--delay 2 --enable-nfs \
113115
--server-addr $SERVER_ADDR \
114116
--client-addr $CLIENT_ADDR \
115117
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \

.github/workflows/catnap.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
--branch origin/$branch_name \
6262
--libos $LIBOS \
6363
--debug \
64-
--test-unit --test-system all --delay 2 \
64+
--test-unit --test-integration --test-system all \
65+
--delay 2 \
6566
--server-addr $SERVER_ADDR \
6667
--client-addr $CLIENT_ADDR
6768
- name: Archive Logs
@@ -109,7 +110,8 @@ jobs:
109110
--repository demikernel \
110111
--branch origin/$branch_name \
111112
--libos $LIBOS \
112-
--test-unit --test-system all --delay 2 \
113+
--test-unit --test-integration --test-system all \
114+
--delay 2 \
113115
--server-addr $SERVER_ADDR \
114116
--client-addr $CLIENT_ADDR \
115117
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \

.github/workflows/catnip.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
--branch origin/$branch_name \
6262
--debug \
6363
--libos $LIBOS \
64-
--test-unit --test-system all --delay 2 \
64+
--test-unit --test-integration --test-system all \
65+
--delay 2 \
6566
--server-addr $SERVER_ADDR \
6667
--client-addr $CLIENT_ADDR
6768
- name: Archive Logs
@@ -109,7 +110,8 @@ jobs:
109110
--repository demikernel \
110111
--branch origin/$branch_name \
111112
--libos $LIBOS \
112-
--test-unit --test-system all --delay 2 \
113+
--test-unit --test-integration --test-system all \
114+
--delay 2 \
113115
--server-addr $SERVER_ADDR \
114116
--client-addr $CLIENT_ADDR \
115117
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \

.github/workflows/catpowder.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
--branch origin/$branch_name \
6262
--debug \
6363
--libos $LIBOS \
64-
--test-unit --test-system all --delay 2 \
64+
--test-unit --test-integration --test-system all \
65+
--delay 2 \
6566
--server-addr $SERVER_ADDR \
6667
--client-addr $CLIENT_ADDR
6768
- name: Archive Logs
@@ -109,7 +110,8 @@ jobs:
109110
--repository demikernel \
110111
--branch origin/$branch_name \
111112
--libos $LIBOS \
112-
--test-unit --test-system all --delay 2 \
113+
--test-unit --test-integration --test-system all \
114+
--delay 2 \
113115
--server-addr $SERVER_ADDR \
114116
--client-addr $CLIENT_ADDR \
115117
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \

tools/ci/job/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def unit_test(self, test_name: str) -> BaseJob:
5959

6060
def integration_test(self, run_mode="") -> BaseJob:
6161
if self.config["platform"] == "windows":
62-
raise Exception("Integration tests are not supported on Windows")
62+
return windows.TcpIntegrationTestJobOnWindows(self.config)
6363
else:
6464
if self.config["libos"] == "catmem":
6565
return linux.PipeIntegrationTestJobOnLinux(self.config, run_mode=run_mode)

tools/ci/job/windows.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4+
import subprocess
5+
import time
46
from ci.task.windows import BaseWindowsTask, CheckoutOnWindows, CompileOnWindows, RunOnWindows, CleanupOnWindows
57
from ci.job.utils import wait_and_report
68
from ci.job.generic import BaseJob
@@ -94,3 +96,25 @@ def __init__(self, config: dict):
9496

9597
def execute(self) -> bool:
9698
return super().execute()
99+
100+
101+
class IntegrationTestJobOnWindows(BaseWindowsJob):
102+
def __init__(self, config: dict, name: str):
103+
super().__init__(config, name)
104+
105+
def execute(self, server_cmd: str) -> bool:
106+
serverTask: RunOnWindows = RunOnWindows(
107+
super().server(), super().repository(), server_cmd, super().is_debug(), super().is_sudo(), super().config_path())
108+
return super().execute(serverTask)
109+
110+
111+
class TcpIntegrationTestJobOnWindows(IntegrationTestJobOnWindows):
112+
113+
def __init__(self, config: dict):
114+
config["all_pass"] = True
115+
super().__init__(config, "integration-test")
116+
self.server_args: str = f"--local-address {super().server_addr()}:12345 --remote-address {super().client_addr()}:23456"
117+
118+
def execute(self) -> bool:
119+
server_cmd: str = f"test-integration-rust TEST_INTEGRATION=tcp-test LIBOS={super().libos()} ARGS=\'{self.server_args}\'"
120+
return super().execute(server_cmd)

tools/demikernel_ci.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
# Runs the CI pipeline.
1919
def run_pipeline(
20-
log_directory: str,
21-
repository: str, branch: str, libos: str, is_debug: bool, server: str, client: str,
22-
test_unit: bool, test_system: str, server_addr: str, client_addr: str, delay: float, config_path: str,
20+
log_directory: str, repository: str, branch: str, libos: str, is_debug:
21+
bool, server: str, client: str, test_unit: bool, test_integration: bool,
22+
test_system: str, server_addr: str, client_addr: str, delay: float, config_path: str,
2323
output_dir: str, enable_nfs: bool, install_prefix: str) -> int:
2424
is_sudo: bool = True if libos == "catnip" or libos == "catpowder" or libos == "catloop" else False
2525
status: dict[str, bool] = {}
@@ -67,7 +67,11 @@ def run_pipeline(
6767
status["unit_tests"] = True
6868
status["unit_tests"] &= factory.unit_test(test_name="test-unit-rust").execute()
6969
status["unit_tests"] &= factory.unit_test(test_name="test-unit-c").execute()
70-
if libos == "catnap" or libos == "catloop":
70+
71+
# STEP 4: Run integration tests.
72+
if test_integration:
73+
if status["checkout"] and status["compile"]:
74+
if libos == "catnap" or libos == "catnapw" or libos == "catloop":
7175
status["integration_tests"] = factory.integration_test().execute()
7276
elif libos == "catmem":
7377
status["integration_tests"] = factory.integration_test("standalone").execute()
@@ -76,7 +80,7 @@ def run_pipeline(
7680
status["integration_tests"] = factory.integration_test("push-wait-async").execute()
7781
status["integration_tests"] = factory.integration_test("pop-wait-async").execute()
7882

79-
# STEP 4: Run system tests.
83+
# STEP 5: Run system tests.
8084
if test_system and config["platform"] == "linux":
8185
if status["checkout"] and status["compile"]:
8286
ci_map = read_yaml(libos)
@@ -240,6 +244,8 @@ def read_args() -> argparse.Namespace:
240244
# Test options.
241245
parser.add_argument("--test-unit", action='store_true',
242246
required=False, help="run unit tests")
247+
parser.add_argument("--test-integration", action='store_true',
248+
required=False, help="run integration tests")
243249
parser.add_argument("--test-system", type=str,
244250
required=False, help="run system tests")
245251
parser.add_argument("--test-redis", action='store_true', required=False, help="run redis tests")
@@ -283,6 +289,7 @@ def main():
283289

284290
# Extract test options.
285291
test_unit: bool = args.test_unit
292+
test_integration: bool = args.test_integration
286293
test_system: str = args.test_system
287294
test_redis: bool = args.test_redis
288295
server_addr: str = args.server_addr
@@ -309,7 +316,7 @@ def main():
309316
mkdir(log_directory)
310317

311318
status: dict = run_pipeline(log_directory, repository, branch, libos, is_debug, server,
312-
client, test_unit, test_system, server_addr,
319+
client, test_unit, test_integration, test_system, server_addr,
313320
client_addr, delay, config_path, output_dir, enable_nfs, install_prefix)
314321

315322
if test_redis:

0 commit comments

Comments
 (0)