-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip dockerized tests in CI on Windows and M-series mac
- Loading branch information
1 parent
dd64de1
commit 7611cba
Showing
13 changed files
with
62 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import { specTest } from "../spec/index.js"; | ||
import { initializer } from "./mongoInitializer.js"; | ||
import { isCI, osHasSupportedContainerRuntime } from "./utils.js"; | ||
|
||
specTest(initializer); | ||
if (isCI() && osHasSupportedContainerRuntime()) { | ||
specTest(initializer); | ||
} else { | ||
it.skip(`${initializer.saverName} skipped in CI because no container runtime is available`, () => {}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import { specTest } from "../spec/index.js"; | ||
import { initializer } from "./postgresInitializer.js"; | ||
import { isCI, osHasSupportedContainerRuntime } from "./utils.js"; | ||
|
||
specTest(initializer); | ||
if (isCI() && osHasSupportedContainerRuntime()) { | ||
specTest(initializer); | ||
} else { | ||
it.skip(`${initializer.saverName} skipped in CI because no container runtime is available`, () => {}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { platform, arch } from "node:os"; | ||
|
||
function isMSeriesMac() { | ||
return platform() === "darwin" && arch() === "arm64"; | ||
} | ||
|
||
function isWindows() { | ||
return platform() === "win32"; | ||
} | ||
|
||
export function isCI() { | ||
// eslint-disable-next-line no-process-env | ||
return (process.env.CI ?? "").toLowerCase() === "true"; | ||
} | ||
|
||
/** | ||
* GitHub Actions doesn't support containers on m-series macOS due to a lack of hypervisor support for nested | ||
* virtualization. | ||
* | ||
* For details, see https://github.com/actions/runner-images/issues/9460#issuecomment-1981203045 | ||
* | ||
* GitHub actions also doesn't support Linux containers on Windows, and may never do so. This is in part due to Docker | ||
* Desktop licensing restrictions, and the complexity of setting up Moby or similar without Docker Desktop. | ||
* Unfortunately, TestContainers doesn't support windows containers, so we can't run the tests on Windows either. | ||
* | ||
* For details, see https://github.com/actions/runner/issues/904 and | ||
* https://java.testcontainers.org/supported_docker_environment/windows/#windows-container-on-windows-wcow | ||
* | ||
* | ||
*/ | ||
export function osHasSupportedContainerRuntime() { | ||
return !isWindows() && !isMSeriesMac(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters