-
Notifications
You must be signed in to change notification settings - Fork 1.4k
build-using-self use a self build of swift-test instead #8548
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
Changes from all commits
03e57b1
f0de0af
20458c0
0df58ba
13c3be0
68efcab
390b512
f1c9dbe
3a621aa
87750c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,8 +102,8 @@ def is_on_darwin() -> bool: | |
def set_environment(*, swiftpm_bin_dir: pathlib.Path,) -> None: | ||
os.environ["SWIFTCI_IS_SELF_HOSTED"] = "1" | ||
|
||
# Set the SWIFTPM_BIN_DIR path | ||
os.environ["SWIFTPM_BIN_DIR"] = str(swiftpm_bin_dir) | ||
# Set the SWIFTPM_CUSTOM_BIN_DIR path | ||
os.environ["SWIFTPM_CUSTOM_BIN_DIR"] = str(swiftpm_bin_dir) | ||
|
||
# Ensure SDKROOT is configure | ||
if is_on_darwin(): | ||
|
@@ -133,6 +133,7 @@ def run_bootstrap(swiftpm_bin_dir: pathlib.Path) -> None: | |
|
||
def main() -> None: | ||
args = get_arguments() | ||
ignore = "-Xlinker /ignore:4217" if os.name == "nt" else "" | ||
logging.getLogger().setLevel(logging.DEBUG if args.is_verbose else logging.INFO) | ||
logging.debug("Args: %r", args) | ||
|
||
|
@@ -144,31 +145,27 @@ def main() -> None: | |
shlex.split("swift --version"), | ||
) | ||
|
||
# call( | ||
# shlex.split("swift package reset"), | ||
# ) | ||
call( | ||
shlex.split("swift package update"), | ||
) | ||
call( | ||
shlex.split(f"swift build --configuration {args.config}"), | ||
) | ||
swift_testing_arg= "--enable-swift-testing" if args.enable_swift_testing else "" | ||
xctest_arg= "--enable-xctest" if args.enable_swift_testing else "" | ||
call( | ||
shlex.split(f"swift test --configuration {args.config} --parallel {swift_testing_arg} {xctest_arg}"), | ||
shlex.split(f"swift build --configuration {args.config} {ignore}"), | ||
) | ||
|
||
with change_directory(REPO_ROOT_PATH / "IntegrationTests"): | ||
call( | ||
shlex.split("swift package update"), | ||
) | ||
call( | ||
shlex.split( | ||
f"{swiftpm_bin_dir / 'swift-test'} --parallel", | ||
posix=(os.name == "posix"), # must be set correctly, otherwhsie shlex.split("C:\\Foo\\bar") become ['CFoobar'] | ||
), | ||
) | ||
if os.name != "nt": # turn off for Windows until we get the hang resolved | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know what may be causing the hangs? It's quite coincidental the hangs started to occurs after the self hosted windows pipeline was changes from using the nightly toolchain, to the nightly 6.1 toolchain. The self-hosted windows toolchain used the official docker image. should we try to see if the released 6.1 image has the same hangs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the 6.1 swiftpm has a bug in it. It's still there in 6.2. We should probably fix it. |
||
swift_testing_arg= "--enable-swift-testing" if args.enable_swift_testing else "" | ||
xctest_arg= "--enable-xctest" if args.enable_swift_testing else "" | ||
call( | ||
shlex.split(f"swift run swift-test --configuration {args.config} --parallel {swift_testing_arg} {xctest_arg} --scratch-path .test {ignore}"), | ||
) | ||
|
||
integration_test_dir = REPO_ROOT_PATH / "IntegrationTests" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to make this code more robust to changes, it would be better to change the That is, change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll be back here to re-enable them on Windows. We can clean things up then. Let's just focus on re-enabling the Windows CI for now. |
||
call( | ||
shlex.split(f"swift package --package-path {integration_test_dir} update"), | ||
) | ||
call( | ||
shlex.split(f"swift run swift-test --package-path {integration_test_dir} --parallel {ignore}"), | ||
) | ||
|
||
if is_on_darwin(): | ||
run_bootstrap(swiftpm_bin_dir=swiftpm_bin_dir) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: It's always nice seeing commented code being removed!