apify-test-tools 0.10.2-beta.19 → 0.10.2-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/cli/apify-test-tools.mjs +114 -114
- package/.github/scripts/run-with-apify-tokens.mjs +6 -6
- package/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml +1 -1
- package/.github/workflows/public_platform-tests.yaml +6 -8
- package/.github/workflows/public_pr-build-test.yaml +11 -11
- package/.github/workflows/public_push-build-latest.yaml +1 -0
- package/CHANGELOG.md +1 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +10 -6
- package/bin/affected-actors.ts +20 -7
- package/bin/diff-changes.ts +40 -16
- package/bin/main.ts +12 -19
- package/bin/run-tests.ts +29 -4
- package/bin/test-files-glob.ts +126 -0
- package/bin/utils/config/load-config.ts +4 -1
- package/bin/utils/config/parser.ts +24 -1
- package/dist/bin/affected-actors.d.ts +13 -4
- package/dist/bin/affected-actors.d.ts.map +1 -1
- package/dist/bin/affected-actors.js +11 -4
- package/dist/bin/affected-actors.js.map +1 -1
- package/dist/bin/diff-changes.d.ts +12 -3
- package/dist/bin/diff-changes.d.ts.map +1 -1
- package/dist/bin/diff-changes.js +25 -12
- package/dist/bin/diff-changes.js.map +1 -1
- package/dist/bin/main.js +11 -17
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/run-tests.d.ts +3 -3
- package/dist/bin/run-tests.d.ts.map +1 -1
- package/dist/bin/run-tests.js +24 -2
- package/dist/bin/run-tests.js.map +1 -1
- package/dist/bin/test-files-glob.d.ts +18 -0
- package/dist/bin/test-files-glob.d.ts.map +1 -0
- package/dist/bin/test-files-glob.js +108 -0
- package/dist/bin/test-files-glob.js.map +1 -0
- package/dist/bin/utils/config/load-config.d.ts +3 -0
- package/dist/bin/utils/config/load-config.d.ts.map +1 -1
- package/dist/bin/utils/config/load-config.js +3 -1
- package/dist/bin/utils/config/load-config.js.map +1 -1
- package/dist/bin/utils/config/parser.d.ts +9 -0
- package/dist/bin/utils/config/parser.d.ts.map +1 -1
- package/dist/bin/utils/config/parser.js +13 -1
- package/dist/bin/utils/config/parser.js.map +1 -1
- package/dist/test/bundle/cli-bundle.test.js +1 -1
- package/dist/test/bundle/cli-bundle.test.js.map +1 -1
- package/dist/test/e2e/cli-bundle.e2e.test.js +1 -1
- package/dist/test/e2e/cli-bundle.e2e.test.js.map +1 -1
- package/dist/test/unit/bin/actor-filtering.test.js +7 -0
- package/dist/test/unit/bin/actor-filtering.test.js.map +1 -1
- package/dist/test/unit/bin/affected-actors-cli.test.js +59 -2
- package/dist/test/unit/bin/affected-actors-cli.test.js.map +1 -1
- package/dist/test/unit/bin/affected-actors.test.js +18 -6
- package/dist/test/unit/bin/affected-actors.test.js.map +1 -1
- package/dist/test/unit/bin/diff-changes.test.js +44 -19
- package/dist/test/unit/bin/diff-changes.test.js.map +1 -1
- package/dist/test/unit/bin/test-cli.test.js +34 -3
- package/dist/test/unit/bin/test-cli.test.js.map +1 -1
- package/dist/test/unit/bin/test-files-glob.test.d.ts +2 -0
- package/dist/test/unit/bin/test-files-glob.test.d.ts.map +1 -0
- package/dist/test/unit/bin/test-files-glob.test.js +102 -0
- package/dist/test/unit/bin/test-files-glob.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/parser.test.js +16 -1
- package/dist/test/unit/bin/utils/config/parser.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/cli.md +46 -29
- package/docs/workflows.md +53 -20
- package/package.json +1 -1
- package/test/bundle/cli-bundle.test.ts +1 -1
- package/test/e2e/cli-bundle.e2e.test.ts +9 -5
- package/test/unit/bin/actor-filtering.test.ts +8 -0
- package/test/unit/bin/affected-actors-cli.test.ts +73 -3
- package/test/unit/bin/affected-actors.test.ts +49 -10
- package/test/unit/bin/diff-changes.test.ts +48 -19
- package/test/unit/bin/test-cli.test.ts +41 -3
- package/test/unit/bin/test-files-glob.test.ts +118 -0
- package/test/unit/bin/utils/config/parser.test.ts +24 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import picomatch from 'picomatch';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Test globs are from the repo root, e.g. `test/platform/**`. `get-affected-actors` matches changed files against the
|
|
8
|
+
* config's `platformTestsGlob` and `test` runs the files `--test-files-glob` matches, so both read globs the same way.
|
|
9
|
+
*/
|
|
10
|
+
const PICOMATCH_OPTIONS = { nocase: true, dot: true } as const;
|
|
11
|
+
|
|
12
|
+
/** Never walked: they hold no test files of the repo, and node_modules can be huge. */
|
|
13
|
+
const SKIPPED_DIRS = new Set(['node_modules', '.git']);
|
|
14
|
+
|
|
15
|
+
const assertRelativeGlob = (glob: string) => {
|
|
16
|
+
if (path.posix.isAbsolute(glob) || path.win32.isAbsolute(glob)) {
|
|
17
|
+
throw new Error(`Test file globs must be relative to the repo root, got "${glob}".`);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Tells whether a repo-root-relative path matches the glob. Without a glob, nothing matches. */
|
|
22
|
+
export const createTestFilesMatcher = (glob?: string): ((filePath: string) => boolean) => {
|
|
23
|
+
if (!glob) return () => false;
|
|
24
|
+
assertRelativeGlob(glob);
|
|
25
|
+
const isMatch = picomatch(glob, PICOMATCH_OPTIONS);
|
|
26
|
+
// One argument only: picomatch's second one returns a truthy object, and Array#filter passes the index there
|
|
27
|
+
return (filePath) => isMatch(filePath);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface Listing {
|
|
31
|
+
/** POSIX paths relative to `cwd` */
|
|
32
|
+
files: string[];
|
|
33
|
+
/** What wasn't walked (skipped directories, symlinks), so the folders holding them never count as fully matched */
|
|
34
|
+
skipped: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Lists the files under `dir`. A missing `dir` has no files. */
|
|
38
|
+
const listFiles = async (cwd: string, dir: string): Promise<Listing> => {
|
|
39
|
+
let entries;
|
|
40
|
+
try {
|
|
41
|
+
entries = await fs.readdir(path.join(cwd, dir), { withFileTypes: true });
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const { code } = error as NodeJS.ErrnoException;
|
|
44
|
+
if (code === 'ENOENT') return { files: [], skipped: [] };
|
|
45
|
+
// A glob without wildcards has the file itself as its base
|
|
46
|
+
if (code === 'ENOTDIR') return { files: [dir], skipped: [] };
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
const listing: Listing = { files: [], skipped: [] };
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const entryPath = path.posix.join(dir, entry.name);
|
|
52
|
+
if (entry.isDirectory() && !SKIPPED_DIRS.has(entry.name)) {
|
|
53
|
+
const inner = await listFiles(cwd, entryPath);
|
|
54
|
+
listing.files.push(...inner.files);
|
|
55
|
+
listing.skipped.push(...inner.skipped);
|
|
56
|
+
} else if (entry.isFile()) {
|
|
57
|
+
listing.files.push(entryPath);
|
|
58
|
+
} else {
|
|
59
|
+
listing.skipped.push(entryPath);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return listing;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const isWithin = (dir: string, base: string) => base === '.' || dir === base || dir.startsWith(`${base}/`);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The directories from `base` down to the file's own directory, `base` first. None when `base` is the file itself,
|
|
69
|
+
* as for a glob without wildcards.
|
|
70
|
+
*/
|
|
71
|
+
const dirsFromBase = (file: string, base: string): string[] => {
|
|
72
|
+
const dirs: string[] = [];
|
|
73
|
+
for (let dir = path.posix.dirname(file); isWithin(dir, base); dir = path.posix.dirname(dir)) {
|
|
74
|
+
dirs.unshift(dir);
|
|
75
|
+
if (dir === base || dir === '.') break;
|
|
76
|
+
}
|
|
77
|
+
return dirs;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Turns the matched files into as few paths as possible: a directory, with a trailing `/`, where the glob matches
|
|
82
|
+
* every file in it, and a single file otherwise. `test/platform/{daily,hourly}/**` gives two paths however many
|
|
83
|
+
* tests the folders hold, so the vitest command line stays short.
|
|
84
|
+
*/
|
|
85
|
+
const toCoveringPaths = ({ files, skipped }: Listing, matched: Set<string>, base: string): string[] => {
|
|
86
|
+
const counts = new Map<string, { total: number; matched: number }>();
|
|
87
|
+
for (const file of [...files, ...skipped]) {
|
|
88
|
+
for (const dir of dirsFromBase(file, base)) {
|
|
89
|
+
const count = counts.get(dir) ?? { total: 0, matched: 0 };
|
|
90
|
+
count.total += 1;
|
|
91
|
+
if (matched.has(file)) count.matched += 1;
|
|
92
|
+
counts.set(dir, count);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const isCovered = (dir: string) => counts.get(dir)!.total === counts.get(dir)!.matched;
|
|
96
|
+
const paths = new Set<string>();
|
|
97
|
+
for (const file of matched) {
|
|
98
|
+
// The highest directory that holds only matched files, so its children are not listed one by one
|
|
99
|
+
const coveredDir = dirsFromBase(file, base).find(isCovered);
|
|
100
|
+
paths.add(coveredDir === undefined ? file : `${coveredDir}/`);
|
|
101
|
+
}
|
|
102
|
+
return [...paths].sort();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
interface ResolvedTestFiles {
|
|
106
|
+
/** Every file the glob matches, as repo-root-relative POSIX paths, sorted */
|
|
107
|
+
files: string[];
|
|
108
|
+
/**
|
|
109
|
+
* The same files as few paths as possible: directories (ending with `/`) that hold only matched files, and the
|
|
110
|
+
* other matched files one by one. Sorted.
|
|
111
|
+
*/
|
|
112
|
+
paths: string[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Finds the files the glob matches. `cwd` is the repo root. Only the glob's static base (`test/platform` for
|
|
117
|
+
* `test/platform/{daily,hourly}/**`) is walked.
|
|
118
|
+
*/
|
|
119
|
+
export const resolveTestFilesGlob = async (glob: string, cwd: string): Promise<ResolvedTestFiles> => {
|
|
120
|
+
const isMatch = createTestFilesMatcher(glob);
|
|
121
|
+
// normalize turns `./test` into `test`, the way git prints paths
|
|
122
|
+
const base = path.posix.normalize(picomatch.scan(glob).base || '.');
|
|
123
|
+
const listing = await listFiles(cwd, base);
|
|
124
|
+
const files = listing.files.filter(isMatch).sort();
|
|
125
|
+
return { files, paths: toCoveringPaths(listing, new Set(files), base) };
|
|
126
|
+
};
|
|
@@ -3,7 +3,7 @@ import type { ActorConfig } from '../../types.js';
|
|
|
3
3
|
import { safeReadJsonObjectFile } from '../json-file.js';
|
|
4
4
|
import { ExistingFile, type RelativeDir } from '../path/repo-relative.js';
|
|
5
5
|
import { readActorJson } from './actor-json.js';
|
|
6
|
-
import { parseConfigFile, parseResolvedConfigFile } from './parser.js';
|
|
6
|
+
import { parseConfigFile, parseRepoSettings, parseResolvedConfigFile, type RepoSettings } from './parser.js';
|
|
7
7
|
import type { ResolvedActorConfig, ValidatedActorConfig } from './structures/base.js';
|
|
8
8
|
|
|
9
9
|
export const CONFIG_FILE_NAME = 'apify-test-tools.config.json';
|
|
@@ -126,3 +126,6 @@ export const readBaseConfigFile = async () => {
|
|
|
126
126
|
}) satisfies PathlessConfig,
|
|
127
127
|
);
|
|
128
128
|
};
|
|
129
|
+
|
|
130
|
+
/** The settings for the whole repository, such as `platformTestsGlob`, with their defaults filled in. */
|
|
131
|
+
export const readRepoSettings = async (): Promise<RepoSettings> => parseRepoSettings(await readConfigFileContents());
|
|
@@ -82,6 +82,28 @@ function verifyConfiguration(body: ValidatedActorConfig[]): void {
|
|
|
82
82
|
if (errors.length > 0) throw new Error(errors.join('\n'));
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/** Which changed files are platform tests, unless the config sets `platformTestsGlob` */
|
|
86
|
+
const DEFAULT_PLATFORM_TESTS_GLOB = 'test/platform/**';
|
|
87
|
+
|
|
88
|
+
/** Settings for the whole repository, next to the Actor entries at the top level of the config. */
|
|
89
|
+
export interface RepoSettings {
|
|
90
|
+
/**
|
|
91
|
+
* Glob from the repo root of the platform test files and their helpers. A change to a matching file is a test
|
|
92
|
+
* change: the tests run, but no release is built for it.
|
|
93
|
+
*/
|
|
94
|
+
platformTestsGlob: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const RepoSettingsSchema = z.object({
|
|
98
|
+
platformTestsGlob: z.string().min(1).default(DEFAULT_PLATFORM_TESTS_GLOB),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export function parseRepoSettings(body: Record<string, unknown>): RepoSettings {
|
|
102
|
+
const parsed = RepoSettingsSchema.safeParse(body);
|
|
103
|
+
if (!parsed.success) throw new Error(z.prettifyError(parsed.error));
|
|
104
|
+
return parsed.data;
|
|
105
|
+
}
|
|
106
|
+
|
|
85
107
|
// eslint-disable-next-line no-underscore-dangle
|
|
86
108
|
export const _privates = {
|
|
87
109
|
selectStrategy,
|
|
@@ -90,7 +112,8 @@ export const _privates = {
|
|
|
90
112
|
};
|
|
91
113
|
|
|
92
114
|
export function parseResolvedConfigFile(body: Record<string, unknown>): ResolvedActorConfig[] {
|
|
93
|
-
|
|
115
|
+
// The repo settings are read by parseRepoSettings, the strategies only see the Actor entries
|
|
116
|
+
const { mode, platformTestsGlob: _platformTestsGlob, ...rest } = body;
|
|
94
117
|
const strategy = selectStrategy({ mode });
|
|
95
118
|
return strategy.parse(rest);
|
|
96
119
|
}
|
|
@@ -12,8 +12,6 @@ interface AffectedActorsOptions {
|
|
|
12
12
|
* counts, and it must be an ancestor of HEAD (e.g. the last release).
|
|
13
13
|
*/
|
|
14
14
|
since?: string;
|
|
15
|
-
/** Glob relative to the repo root. Matching files count as changes even when .dockerignore lists them. */
|
|
16
|
-
testFilesGlob?: string;
|
|
17
15
|
actors: string[];
|
|
18
16
|
ignore: string[];
|
|
19
17
|
}
|
|
@@ -32,15 +30,26 @@ interface AffectedActors {
|
|
|
32
30
|
functionallyChangedActors: {
|
|
33
31
|
actorFullName: string;
|
|
34
32
|
}[];
|
|
35
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Actors with cosmetic changes (README, CHANGELOG, cosmetic .actor JSON) and no functional one. They only need a
|
|
35
|
+
* release build.
|
|
36
|
+
*/
|
|
36
37
|
cosmeticallyChangedActors: {
|
|
37
38
|
actorFullName: string;
|
|
38
39
|
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Actors whose platform tests (`platformTestsGlob` in the config) changed in their context, whatever else
|
|
42
|
+
* changed. Their tests need to run, but a test change alone needs no release. An Actor can also be in one of the
|
|
43
|
+
* lists above.
|
|
44
|
+
*/
|
|
45
|
+
testChangedActors: {
|
|
46
|
+
actorFullName: string;
|
|
47
|
+
}[];
|
|
39
48
|
}
|
|
40
49
|
/**
|
|
41
50
|
* Finds the Actors whose context changed in the given range. `base` selects the branch's own changes
|
|
42
51
|
* (a PR), `since` the changes after a known commit (a release, or the last validated commit of a PR).
|
|
43
52
|
*/
|
|
44
|
-
export declare const getAffectedActors: ({ base, since: sinceOption,
|
|
53
|
+
export declare const getAffectedActors: ({ base, since: sinceOption, actors, ignore, }: AffectedActorsOptions) => Promise<AffectedActors>;
|
|
45
54
|
export {};
|
|
46
55
|
//# sourceMappingURL=affected-actors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affected-actors.d.ts","sourceRoot":"","sources":["../../bin/affected-actors.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAe,MAAM,EAAY,MAAM,YAAY,CAAC;AAMhE,UAAU,qBAAqB;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"affected-actors.d.ts","sourceRoot":"","sources":["../../bin/affected-actors.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAe,MAAM,EAAY,MAAM,YAAY,CAAC;AAMhE,UAAU,qBAAqB;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,gHAAgH;AAChH,UAAU,cAAc;IACpB,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,0HAA0H;IAC1H,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,yBAAyB,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD;;;OAGG;IACH,yBAAyB,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD;;;;OAIG;IACH,iBAAiB,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClD;AA8FD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAU,+CAKrC,qBAAqB,KAAG,OAAO,CAAC,cAAc,CAiDhD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getChangedActors } from './diff-changes.js';
|
|
2
2
|
import { findCommitSha, getChangedFilesBetween, getChangelogAdditions, getCommitsBetween, getMergeBase, resolveCommitSha, resolveReleaseBaseCommit, } from './git.js';
|
|
3
3
|
import { logger } from './logger.js';
|
|
4
|
-
import { readConfigFile } from './utils/config/load-config.js';
|
|
4
|
+
import { readConfigFile, readRepoSettings } from './utils/config/load-config.js';
|
|
5
5
|
// The range always ends at the checked-out commit: check out what you want to inspect
|
|
6
6
|
const HEAD = 'HEAD';
|
|
7
7
|
const names = (configs) => configs.map(({ actorFullName }) => ({ actorFullName }));
|
|
@@ -63,7 +63,12 @@ const findValidatedSha = async (since, headSha) => {
|
|
|
63
63
|
* base's change, which base already validated.
|
|
64
64
|
*/
|
|
65
65
|
const intersectChangedInBranchVsSince = (branch, sinceValidated) => {
|
|
66
|
-
const narrowed = {
|
|
66
|
+
const narrowed = {
|
|
67
|
+
functional: [],
|
|
68
|
+
cosmetic: [],
|
|
69
|
+
// The same rule for tests: the branch changed them, and they changed again since they were last validated
|
|
70
|
+
test: branch.test.filter((actor) => sinceValidated.test.includes(actor)),
|
|
71
|
+
};
|
|
67
72
|
// All checks are done for each Actor separately, that's cleanest and most accurate
|
|
68
73
|
for (const actor of [...branch.functional, ...branch.cosmetic]) {
|
|
69
74
|
// base...HEAD
|
|
@@ -89,13 +94,14 @@ const intersectChangedInBranchVsSince = (branch, sinceValidated) => {
|
|
|
89
94
|
* Finds the Actors whose context changed in the given range. `base` selects the branch's own changes
|
|
90
95
|
* (a PR), `since` the changes after a known commit (a release, or the last validated commit of a PR).
|
|
91
96
|
*/
|
|
92
|
-
export const getAffectedActors = async ({ base, since: sinceOption,
|
|
97
|
+
export const getAffectedActors = async ({ base, since: sinceOption, actors, ignore, }) => {
|
|
93
98
|
// An empty --since (e.g. an empty cache file) means the same as not passing it
|
|
94
99
|
const since = sinceOption || undefined;
|
|
95
100
|
if (!base && !since) {
|
|
96
101
|
throw new Error('Pass --base, --since, or both to select the commits to inspect.');
|
|
97
102
|
}
|
|
98
103
|
const actorConfigs = await readConfigFile({ actors, ignore });
|
|
104
|
+
const { platformTestsGlob } = await readRepoSettings();
|
|
99
105
|
const getChangedInRange = async (range) => {
|
|
100
106
|
const changedFiles = await getChangedFilesBetween(range.fromRef, range.toRef);
|
|
101
107
|
return {
|
|
@@ -104,7 +110,7 @@ export const getAffectedActors = async ({ base, since: sinceOption, testFilesGlo
|
|
|
104
110
|
filepathsChanged: changedFiles,
|
|
105
111
|
actorConfigs,
|
|
106
112
|
range,
|
|
107
|
-
|
|
113
|
+
platformTestsGlob,
|
|
108
114
|
}),
|
|
109
115
|
};
|
|
110
116
|
};
|
|
@@ -130,6 +136,7 @@ export const getAffectedActors = async ({ base, since: sinceOption, testFilesGlo
|
|
|
130
136
|
changelog: await getChangelogAdditions(rangeVsBase.fromRef, rangeVsBase.toRef, changedFiles),
|
|
131
137
|
functionallyChangedActors: names(changedActors.functional),
|
|
132
138
|
cosmeticallyChangedActors: names(changedActors.cosmetic),
|
|
139
|
+
testChangedActors: names(changedActors.test),
|
|
133
140
|
};
|
|
134
141
|
};
|
|
135
142
|
//# sourceMappingURL=affected-actors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affected-actors.js","sourceRoot":"","sources":["../../bin/affected-actors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"affected-actors.js","sourceRoot":"","sources":["../../bin/affected-actors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjF,sFAAsF;AACtF,MAAM,IAAI,GAAG,MAAM,CAAC;AA6CpB,MAAM,KAAK,GAAG,CAAC,OAAsB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,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 interface ShouldBuildAndTestOptions {
|
|
|
4
4
|
actorConfigs: ActorConfig[];
|
|
5
5
|
/** The range the files changed in, to compare `.actor` JSON files across. */
|
|
6
6
|
range: GitRange;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Glob of the platform test files, from the repo root (`platformTestsGlob` in the config). A change to a matching
|
|
9
|
+
* file is a test change, even when .dockerignore lists it.
|
|
10
|
+
*/
|
|
11
|
+
platformTestsGlob?: string;
|
|
8
12
|
}
|
|
9
13
|
export interface ChangedActors {
|
|
10
14
|
/** Actors with at least one functional change. They need a new build and tests. */
|
|
11
15
|
functional: ActorConfig[];
|
|
12
|
-
/** Actors
|
|
16
|
+
/** Actors with cosmetic changes and no functional one. They only need a new build when released. */
|
|
13
17
|
cosmetic: ActorConfig[];
|
|
18
|
+
/**
|
|
19
|
+
* Actors with at least one platform test change, whatever else changed. Their tests need to run, but test changes
|
|
20
|
+
* alone need no release. An Actor can be in this list and in one of the others.
|
|
21
|
+
*/
|
|
22
|
+
test: ActorConfig[];
|
|
14
23
|
}
|
|
15
24
|
/** Finds the Actors the changed files belong to, split by the most impactful change each Actor has. */
|
|
16
|
-
export declare const getChangedActors: ({ filepathsChanged, actorConfigs, range,
|
|
25
|
+
export declare const getChangedActors: ({ filepathsChanged, actorConfigs, range, platformTestsGlob, }: ShouldBuildAndTestOptions) => Promise<ChangedActors>;
|
|
17
26
|
export {};
|
|
18
27
|
//# sourceMappingURL=diff-changes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-changes.d.ts","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diff-changes.d.ts","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGxD,UAAU,yBAAyB;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,6EAA6E;IAC7E,KAAK,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiKD,MAAM,WAAW,aAAa;IAC1B,mFAAmF;IACnF,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,oGAAoG;IACpG,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB;;;OAGG;IACH,IAAI,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,GAAU,+DAKpC,yBAAyB,KAAG,OAAO,CAAC,aAAa,CA+DnD,CAAC"}
|
package/dist/bin/diff-changes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import picomatch from 'picomatch';
|
|
2
1
|
import { isCosmeticOnlyJsonSchemaChange } from './diff-json-schema.js';
|
|
3
2
|
import { loadDockerIgnore } from './dockerignore.js';
|
|
4
3
|
import { logger } from './logger.js';
|
|
4
|
+
import { createTestFilesMatcher } from './test-files-glob.js';
|
|
5
5
|
import { RelativeFile } from './utils/path/repo-relative.js';
|
|
6
6
|
const IGNORED_TOP_LEVEL_FILES = [
|
|
7
7
|
'.vscode/',
|
|
@@ -24,11 +24,13 @@ const isIgnoredTopLevelFile = (filePath, contextPath) => {
|
|
|
24
24
|
* not one per actor, so it applies to every actor regardless of context/folder.
|
|
25
25
|
* 2. Context matching (actorConfig.contextPaths) → outside-context if no match
|
|
26
26
|
* 3. Hardcoded ignore list, checked against the path hoisted relative to the matched context entry → ignored
|
|
27
|
-
* 4.
|
|
28
|
-
*
|
|
29
|
-
* 5.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* 4. Platform test files (`platformTestsGlob`) → test, even when .dockerignore lists them. A test change needs the
|
|
28
|
+
* tests to run, but no release.
|
|
29
|
+
* 5. .dockerignore filtering (patterns relative to dockerContextDir), skipped for the actor's own `.actor/`
|
|
30
|
+
* dir → ignored if matched
|
|
31
|
+
* 6. README.md by filename → cosmetic if inside the actor's own folder, otherwise ignored
|
|
32
|
+
* 7. .json inside the actor's own `.actor/` dir with only cosmetic schema diffs → cosmetic (semantically verified)
|
|
33
|
+
* 8. Everything else → functional
|
|
32
34
|
*/
|
|
33
35
|
const classifyFileChange = async (changedFile, actorConfig, range, dockerIgnoreMatcher, isTestFile) => {
|
|
34
36
|
const lowercaseFilePath = changedFile.path.toLowerCase();
|
|
@@ -45,12 +47,15 @@ const classifyFileChange = async (changedFile, actorConfig, range, dockerIgnoreM
|
|
|
45
47
|
if (isIgnoredTopLevelFile(changedFile, matchedContext)) {
|
|
46
48
|
return { impact: 'ignored' };
|
|
47
49
|
}
|
|
50
|
+
// Test files are often in .dockerignore, but a change to them must still run the tests
|
|
51
|
+
if (isTestFile(changedFile.path)) {
|
|
52
|
+
return { impact: 'test' };
|
|
53
|
+
}
|
|
48
54
|
const isUnderActorDotDir = actorConfig.actorJson.file.parent.contains(changedFile);
|
|
49
55
|
// .actor/ can legitimately be listed in .dockerignore (the Apify platform evaluates it before
|
|
50
56
|
// the Docker build, so excluding it from the build context is a valid caching optimization) —
|
|
51
57
|
// that shouldn't cause changes to .actor/ itself to be ignored here.
|
|
52
|
-
|
|
53
|
-
if (!isUnderActorDotDir && !isTestFile(changedFile.path) && dockerIgnoreMatcher(changedFile.path)) {
|
|
58
|
+
if (!isUnderActorDotDir && dockerIgnoreMatcher(changedFile.path)) {
|
|
54
59
|
return { impact: 'ignored' };
|
|
55
60
|
}
|
|
56
61
|
const isInActorFolder = changedFile.isWithin(actorConfig.folder);
|
|
@@ -119,10 +124,10 @@ const logChangeGroups = (groups) => {
|
|
|
119
124
|
}
|
|
120
125
|
};
|
|
121
126
|
/** Finds the Actors the changed files belong to, split by the most impactful change each Actor has. */
|
|
122
|
-
export const getChangedActors = async ({ filepathsChanged, actorConfigs, range,
|
|
127
|
+
export const getChangedActors = async ({ filepathsChanged, actorConfigs, range, platformTestsGlob, }) => {
|
|
123
128
|
const actorsChangedMap = new Map();
|
|
124
129
|
const testFilesInContext = new Set();
|
|
125
|
-
const isTestFile =
|
|
130
|
+
const isTestFile = createTestFilesMatcher(platformTestsGlob);
|
|
126
131
|
for (const actorConfig of actorConfigs) {
|
|
127
132
|
const dockerIgnoreMatcher = loadDockerIgnore(actorConfig.dockerContextDir);
|
|
128
133
|
for (const originalFilePath of filepathsChanged) {
|
|
@@ -140,9 +145,13 @@ export const getChangedActors = async ({ filepathsChanged, actorConfigs, range,
|
|
|
140
145
|
actorConfig,
|
|
141
146
|
files: [],
|
|
142
147
|
hasFunctionalChange: false,
|
|
148
|
+
hasCosmeticChange: false,
|
|
149
|
+
hasTestChange: false,
|
|
143
150
|
};
|
|
144
151
|
entry.files.push(originalFilePath);
|
|
145
152
|
entry.hasFunctionalChange ||= change.impact === 'functional';
|
|
153
|
+
entry.hasCosmeticChange ||= change.impact === 'cosmetic';
|
|
154
|
+
entry.hasTestChange ||= change.impact === 'test';
|
|
146
155
|
actorsChangedMap.set(actorConfig.folder.path, entry);
|
|
147
156
|
}
|
|
148
157
|
}
|
|
@@ -155,10 +164,14 @@ export const getChangedActors = async ({ filepathsChanged, actorConfigs, range,
|
|
|
155
164
|
}
|
|
156
165
|
const entries = Array.from(actorsChangedMap.values());
|
|
157
166
|
const functional = entries.filter((entry) => entry.hasFunctionalChange).map((entry) => entry.actorConfig);
|
|
158
|
-
const cosmetic = entries
|
|
167
|
+
const cosmetic = entries
|
|
168
|
+
.filter((entry) => !entry.hasFunctionalChange && entry.hasCosmeticChange)
|
|
169
|
+
.map((entry) => entry.actorConfig);
|
|
170
|
+
const test = entries.filter((entry) => entry.hasTestChange).map((entry) => entry.actorConfig);
|
|
159
171
|
const names = (configs) => configs.map((config) => config.actorFullName).join(', ') || 'none';
|
|
160
172
|
logger.info(`[DIFF]: Actors with functional changes: ${names(functional)}`);
|
|
161
173
|
logger.info(`[DIFF]: Actors with only cosmetic changes: ${names(cosmetic)}`);
|
|
162
|
-
|
|
174
|
+
logger.info(`[DIFF]: Actors with platform test changes: ${names(test)}`);
|
|
175
|
+
return { functional, cosmetic, test };
|
|
163
176
|
};
|
|
164
177
|
//# sourceMappingURL=diff-changes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-changes.js","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"diff-changes.js","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAA4B,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAoB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAc/E,MAAM,uBAAuB,GAAG;IAC5B,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,mBAAmB;IACnB,aAAa;IACb,eAAe;CAClB,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,QAAsB,EAAE,WAAwB,EAAW,EAAE;IACxF,MAAM,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAClF,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC;AASF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,kBAAkB,GAAG,KAAK,EAC5B,WAAyB,EACzB,WAAwB,EACxB,KAAe,EACf,mBAAwC,EACxC,UAAyC,EACd,EAAE;IAC7B,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC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AEzE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC1C,CAAC,CAAC"}
|
package/dist/bin/main.js
CHANGED
|
@@ -48,10 +48,6 @@ const affectedRangeOptions = {
|
|
|
48
48
|
type: 'string',
|
|
49
49
|
describe: 'Only count commits after this one. Ignored with --base if it is not on the branch',
|
|
50
50
|
},
|
|
51
|
-
'test-files-glob': {
|
|
52
|
-
type: 'string',
|
|
53
|
-
describe: 'Glob (from the repo root) of test files that count as changes even when .dockerignore lists them',
|
|
54
|
-
},
|
|
55
51
|
};
|
|
56
52
|
/**
|
|
57
53
|
* For commands that change something (builds, deletes, Slack posts). A dry run still does every read and check
|
|
@@ -89,14 +85,18 @@ const envVarsSyncOptions = {
|
|
|
89
85
|
};
|
|
90
86
|
/** Flags of `test`, which runs the repository's vitest on the Actors piped in, e.g. the builds from `build`. */
|
|
91
87
|
const testOptions = {
|
|
88
|
+
'test-files-glob': {
|
|
89
|
+
type: 'string',
|
|
90
|
+
default: 'test/platform/**',
|
|
91
|
+
describe: 'Glob (from the repo root) of the test files to run. Quote it, so the shell does not expand it',
|
|
92
|
+
},
|
|
92
93
|
'vitest-output-file': { type: 'string', describe: "Also keep vitest's own JSON report there, e.g. to upload it" },
|
|
93
94
|
reporter: {
|
|
94
95
|
type: 'string',
|
|
95
96
|
describe: 'Vitest reporter (https://vitest.dev/guide/reporters) to add to `default` and `json`, which are always on, ' +
|
|
96
97
|
'e.g. github-actions. Repeat it for more',
|
|
97
|
-
// A plain string, not `array: true`: yargs would fill an array option with the arguments after it too
|
|
98
|
-
//
|
|
99
|
-
// still comes as an array, a single one as a string, so both are normalized to an array.
|
|
98
|
+
// A plain string, not `array: true`: yargs would fill an array option with the arguments after it too. A
|
|
99
|
+
// repeated flag still comes as an array, a single one as a string, so both are normalized to an array.
|
|
100
100
|
coerce: (value) => (value === undefined ? [] : [value].flat()),
|
|
101
101
|
},
|
|
102
102
|
};
|
|
@@ -154,16 +154,9 @@ await yargs()
|
|
|
154
154
|
.command('get-affected-actors', 'Find the Actors whose context changed in a commit range ending at the checked-out HEAD', (y) => y.options(affectedRangeOptions).options(actorSelectionOptions), async (args) => {
|
|
155
155
|
writeJson(await getAffectedActors(args));
|
|
156
156
|
})
|
|
157
|
-
.command('test
|
|
158
|
-
.positional('filters', {
|
|
159
|
-
type: 'string',
|
|
160
|
-
array: true,
|
|
161
|
-
default: ['test/platform'],
|
|
162
|
-
describe: 'Test files to run, as vitest filters',
|
|
163
|
-
})
|
|
164
|
-
.options(testOptions), async (args) => {
|
|
157
|
+
.command('test', 'Run the tests of the Actors listed on stdin (builds from build, or get-actor-configs for default builds), and print a report for notify', (y) => y.options(testOptions), async (args) => {
|
|
165
158
|
const report = await runTests({
|
|
166
|
-
|
|
159
|
+
testFilesGlob: args.testFilesGlob,
|
|
167
160
|
targets: parseTestTargets(await readStdin()),
|
|
168
161
|
vitestOutputFile: args.vitestOutputFile,
|
|
169
162
|
reporters: args.reporter,
|
|
@@ -187,7 +180,8 @@ await yargs()
|
|
|
187
180
|
.command('build', 'Build the Actors listed on stdin, as {"actors": [{"actorFullName": ...}]}, from the checked-out branch', (y) => y.options(buildOptions).options(repoUrlOptions).options(envVarsSyncOptions).options(dryRunOptions), async (args) => {
|
|
188
181
|
const input = parseBuildInput(await readStdin());
|
|
189
182
|
const names = input.actors.map(({ actorFullName }) => actorFullName);
|
|
190
|
-
// An empty --actors selects every Actor, but an empty list here means there is nothing to build
|
|
183
|
+
// An empty --actors selects every Actor, but an empty list here means there is nothing to build. The configs
|
|
184
|
+
// are picked by name, so an Actor listed twice (e.g. in two lists of get-affected-actors) is built once
|
|
191
185
|
const actorConfigs = names.length > 0 ? await readConfigFile({ actors: names, ignore: [] }) : [];
|
|
192
186
|
const builds = await buildActors({
|
|
193
187
|
actorConfigs,
|
package/dist/bin/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"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,yFAAyF;IACzF,IAAI,GAAG,EAAE,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACJ,kEAAkE;QAClE,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC;KACD,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/bin/run-tests.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TestTarget } from './stdin-input.js';
|
|
2
2
|
import { type TestReport } from './test-report.js';
|
|
3
3
|
interface RunTestsOptions {
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/** Glob from the repo root (`cwd`) of the test files to run, e.g. `test/platform/**` */
|
|
5
|
+
testFilesGlob: string;
|
|
6
6
|
/** The Actors to test, each with its build or, without one, its default build */
|
|
7
7
|
targets: TestTarget[];
|
|
8
8
|
/** Keeps vitest's own JSON report there, e.g. to upload it */
|
|
@@ -16,6 +16,6 @@ interface RunTestsOptions {
|
|
|
16
16
|
* goes to stderr, so stdout stays free for the report. A failing test or a crashing vitest is a failed report, not
|
|
17
17
|
* an error: the report is how the failure gets to `notify`.
|
|
18
18
|
*/
|
|
19
|
-
export declare const runTests: ({
|
|
19
|
+
export declare const runTests: ({ testFilesGlob, targets, vitestOutputFile, reporters, cwd, }: RunTestsOptions) => Promise<TestReport>;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=run-tests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-tests.d.ts","sourceRoot":"","sources":["../../bin/run-tests.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"run-tests.d.ts","sourceRoot":"","sources":["../../bin/run-tests.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAkC,KAAK,UAAU,EAAuC,MAAM,kBAAkB,CAAC;AA2CxH,UAAU,eAAe;IACrB,wFAAwF;IACxF,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iHAAiH;IACjH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAU,+DAM5B,eAAe,KAAG,OAAO,CAAC,UAAU,CA6DtC,CAAC"}
|