From 3494760a6d03d7170d79fdb54e1f214407a85cd8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 11:58:55 +0000 Subject: [PATCH] test: make the monorepo push tests pass on Windows Two actor-runtime tests assumed POSIX paths and modes: - resolveDockerContext's expected roots were built with join('/repo'), which on Windows gives '\repo' while the command's resolve() gives 'D:\repo'. The test now resolves the same way. - The tarball mode assertion expected 0o755 after chmod, but Windows has no execute bit, so the archive records 0o666. The assertion is skipped there, as the other mode tests already do. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_015JzfLYa5CHCXxfzC1No3gV --- test/local/commands/push-monorepo.test.ts | 3 ++- test/local/lib/runtime-source-context.test.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/local/commands/push-monorepo.test.ts b/test/local/commands/push-monorepo.test.ts index 0b12f7e36..f58be8ca0 100644 --- a/test/local/commands/push-monorepo.test.ts +++ b/test/local/commands/push-monorepo.test.ts @@ -308,7 +308,8 @@ describe('apify push of a monorepo Actor to a local Actor runtime', () => { expect(names).not.toContain('packages/typescript-utils/src/index.ts'); // Untracked and not ignored: pushed, with a warning that the platform would not have it yet. expect(names).toContain('shared/start.sh'); - expect(modes.get('shared/start.sh')).toBe(0o755); + // Windows has no execute bit, so chmod cannot set one and the tarball records the default mode. + if (process.platform !== 'win32') expect(modes.get('shared/start.sh')).toBe(0o755); expect(logMessages.error.join('\n')).toContain('changes that are not committed'); }); diff --git a/test/local/lib/runtime-source-context.test.ts b/test/local/lib/runtime-source-context.test.ts index 8bec1d357..1dd04a9af 100644 --- a/test/local/lib/runtime-source-context.test.ts +++ b/test/local/lib/runtime-source-context.test.ts @@ -1,16 +1,18 @@ -import { join } from 'node:path'; +import { join, resolve } from 'node:path'; import { resolveDockerContext } from '../../../src/lib/runtime/source-context.js'; -const actorDir = join('/repo', 'actors', 'a'); +// `resolve`, not `join`: on Windows the resolved context carries the drive (`D:\repo`), as the command resolves it. +const repoDir = resolve('/repo'); +const actorDir = join(repoDir, 'actors', 'a'); describe('resolveDockerContext', () => { it('resolves dockerContextDir relative to the .actor folder', () => { // Outside a Git repository, the context itself is what is pushed. expect(resolveDockerContext(actorDir, '../../..')).toEqual({ kind: 'context', - contextRoot: join('/repo'), - sourceRoot: join('/repo'), + contextRoot: repoDir, + sourceRoot: repoDir, actorPath: 'actors/a', }); });