MCPcopy Create free account
hub / github.com/Noumena-Network/code / createArtifact

Function createArtifact

src/testing/wrapperPtyHarness.test.ts:33–55  ·  view source on GitHub ↗
(
  repoRoot: string,
  bucket: string,
  mtimeMs: number,
  options?: {
    readonly isolationDir?: string
    readonly tree?: 'art' | 'gen'
  },
)

Source from the content-addressed store, hash-verified

31})
32
33function createArtifact(
34 repoRoot: string,
35 bucket: string,
36 mtimeMs: number,
37 options?: {
38 readonly isolationDir?: string
39 readonly tree?: 'art' | 'gen'
40 },
41): string {
42 const artifactPath = join(
43 repoRoot,
44 options?.isolationDir
45 ? `buck-out/${options.isolationDir}/${options.tree ?? 'art'}/fbcode`
46 : `buck-out/v2/${options?.tree ?? 'art'}/fbcode`,
47 bucket,
48 'code/__self_contained_bin__/out/ncode',
49 )
50 mkdirSync(join(artifactPath, '..'), { recursive: true })
51 writeFileSync(artifactPath, `artifact:${bucket}\n`, 'utf8')
52 const seconds = mtimeMs / 1000
53 utimesSync(artifactPath, seconds, seconds)
54 return artifactPath
55}
56
57describe('wrapperPtyHarness artifact resolution', () => {
58 it('finds self-contained artifact candidates by explicit directory walk', () => {

Callers 1

Calls 1

mkdirSyncFunction · 0.90

Tested by

no test coverage detected