apify-test-tools 0.1.0

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.
Files changed (103) hide show
  1. package/README.md +23 -0
  2. package/bin/build.ts +287 -0
  3. package/bin/consts.ts +6 -0
  4. package/bin/git.ts +56 -0
  5. package/bin/github.ts +75 -0
  6. package/bin/main.ts +145 -0
  7. package/bin/slack.ts +72 -0
  8. package/bin/test-report.ts +146 -0
  9. package/bin/types.ts +102 -0
  10. package/bin/utils.ts +204 -0
  11. package/dist/bin/build.d.ts +18 -0
  12. package/dist/bin/build.d.ts.map +1 -0
  13. package/dist/bin/build.js +222 -0
  14. package/dist/bin/build.js.map +1 -0
  15. package/dist/bin/consts.d.ts +4 -0
  16. package/dist/bin/consts.d.ts.map +1 -0
  17. package/dist/bin/consts.js +6 -0
  18. package/dist/bin/consts.js.map +1 -0
  19. package/dist/bin/git.d.ts +7 -0
  20. package/dist/bin/git.d.ts.map +1 -0
  21. package/dist/bin/git.js +47 -0
  22. package/dist/bin/git.js.map +1 -0
  23. package/dist/bin/github.d.ts +12 -0
  24. package/dist/bin/github.d.ts.map +1 -0
  25. package/dist/bin/github.js +64 -0
  26. package/dist/bin/github.js.map +1 -0
  27. package/dist/bin/main.d.ts +3 -0
  28. package/dist/bin/main.d.ts.map +1 -0
  29. package/dist/bin/main.js +117 -0
  30. package/dist/bin/main.js.map +1 -0
  31. package/dist/bin/slack.d.ts +12 -0
  32. package/dist/bin/slack.d.ts.map +1 -0
  33. package/dist/bin/slack.js +46 -0
  34. package/dist/bin/slack.js.map +1 -0
  35. package/dist/bin/test-report.d.ts +10 -0
  36. package/dist/bin/test-report.d.ts.map +1 -0
  37. package/dist/bin/test-report.js +74 -0
  38. package/dist/bin/test-report.js.map +1 -0
  39. package/dist/bin/types.d.ts +88 -0
  40. package/dist/bin/types.d.ts.map +1 -0
  41. package/dist/bin/types.js +2 -0
  42. package/dist/bin/types.js.map +1 -0
  43. package/dist/bin/utils.d.ts +26 -0
  44. package/dist/bin/utils.d.ts.map +1 -0
  45. package/dist/bin/utils.js +164 -0
  46. package/dist/bin/utils.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +3 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/lib/consts.d.ts +3 -0
  52. package/dist/lib/consts.d.ts.map +1 -0
  53. package/dist/lib/consts.js +14 -0
  54. package/dist/lib/consts.js.map +1 -0
  55. package/dist/lib/extend-expect.d.ts +3 -0
  56. package/dist/lib/extend-expect.d.ts.map +1 -0
  57. package/dist/lib/extend-expect.js +228 -0
  58. package/dist/lib/extend-expect.js.map +1 -0
  59. package/dist/lib/lib.d.ts +16 -0
  60. package/dist/lib/lib.d.ts.map +1 -0
  61. package/dist/lib/lib.js +91 -0
  62. package/dist/lib/lib.js.map +1 -0
  63. package/dist/lib/run-test-result.d.ts +20 -0
  64. package/dist/lib/run-test-result.d.ts.map +1 -0
  65. package/dist/lib/run-test-result.js +62 -0
  66. package/dist/lib/run-test-result.js.map +1 -0
  67. package/dist/lib/types.d.ts +107 -0
  68. package/dist/lib/types.d.ts.map +1 -0
  69. package/dist/lib/types.js +2 -0
  70. package/dist/lib/types.js.map +1 -0
  71. package/dist/lib/utils.d.ts +7 -0
  72. package/dist/lib/utils.d.ts.map +1 -0
  73. package/dist/lib/utils.js +30 -0
  74. package/dist/lib/utils.js.map +1 -0
  75. package/dist/test/unit/custom-matchers.test.d.ts +2 -0
  76. package/dist/test/unit/custom-matchers.test.d.ts.map +1 -0
  77. package/dist/test/unit/custom-matchers.test.js +53 -0
  78. package/dist/test/unit/custom-matchers.test.js.map +1 -0
  79. package/dist/test/unit/should-built-and-test.test.d.ts +2 -0
  80. package/dist/test/unit/should-built-and-test.test.d.ts.map +1 -0
  81. package/dist/test/unit/should-built-and-test.test.js +136 -0
  82. package/dist/test/unit/should-built-and-test.test.js.map +1 -0
  83. package/dist/test/unit/test-actor.test.d.ts +2 -0
  84. package/dist/test/unit/test-actor.test.d.ts.map +1 -0
  85. package/dist/test/unit/test-actor.test.js +17 -0
  86. package/dist/test/unit/test-actor.test.js.map +1 -0
  87. package/dist/tsconfig.tsbuildinfo +1 -0
  88. package/example-github-events/pull-request.json +523 -0
  89. package/example-github-events/push.json +216 -0
  90. package/index.ts +2 -0
  91. package/lib/consts.ts +15 -0
  92. package/lib/extend-expect.ts +268 -0
  93. package/lib/lib.ts +134 -0
  94. package/lib/run-test-result.ts +70 -0
  95. package/lib/types.ts +131 -0
  96. package/lib/utils.ts +49 -0
  97. package/package.json +41 -0
  98. package/scripts/hook-job-started.sh +11 -0
  99. package/test/tsconfig.json +15 -0
  100. package/test/unit/custom-matchers.test.ts +61 -0
  101. package/test/unit/should-built-and-test.test.ts +166 -0
  102. package/test/unit/test-actor.test.ts +17 -0
  103. package/tsconfig.json +20 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-report.d.ts","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAIA,UAAU,wBAAwB;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,iBAAiB,+EAM3B,wBAAwB,kBA4E1B,CAAC"}
@@ -0,0 +1,74 @@
1
+ import fs from 'fs/promises';
2
+ import { sendSlackMessage } from './slack.js';
3
+ import { getEnvVar } from './utils.js';
4
+ export const reportTestRestuls = async ({ dryRun, reportFile: jsonResultsPath, jobUrl, workflowName, repository, }) => {
5
+ const results = JSON.parse((await fs.readFile(jsonResultsPath)).toString());
6
+ const passed = [];
7
+ const failed = [];
8
+ for (const result of results.testResults) {
9
+ if (result.status !== 'failed') {
10
+ passed.push(...result.assertionResults);
11
+ continue;
12
+ }
13
+ for (const aResult of result.assertionResults) {
14
+ if (aResult.status !== 'failed') {
15
+ passed.push(aResult);
16
+ }
17
+ else {
18
+ failed.push(aResult);
19
+ }
20
+ }
21
+ }
22
+ const failedAssertions = [];
23
+ console.error();
24
+ console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
25
+ console.error();
26
+ console.error('**************************************************');
27
+ console.error('* Successes *');
28
+ console.error('**************************************************');
29
+ console.error();
30
+ for (const [i, aResult] of passed.entries()) {
31
+ const { fullName } = aResult;
32
+ console.error(`${i + 1}) ${fullName} ... ${aResult.meta.runLink}`);
33
+ console.error();
34
+ }
35
+ console.error('**************************************************');
36
+ console.error('* Failures *');
37
+ console.error('**************************************************');
38
+ console.error();
39
+ for (const [i, aResult] of failed.entries()) {
40
+ const { failureMessages, fullName } = aResult;
41
+ if (failureMessages) {
42
+ failedAssertions.push(...failureMessages.map(message => message.split('\n')?.[0]));
43
+ }
44
+ console.error(`${i + 1}) ${fullName} ... ${aResult.meta.runLink}`);
45
+ console.error();
46
+ }
47
+ console.error();
48
+ console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
49
+ console.error();
50
+ if (failedAssertions.length === 0) {
51
+ return;
52
+ }
53
+ // TODO: add slack profiles
54
+ const total = failed.length + passed.length;
55
+ const jobLink = jobUrl ? ` Check <${jobUrl}|the job>.` : '';
56
+ let slackMessage = `\`${workflowName ?? '-'}\`: *${repository ?? '-'}*`;
57
+ slackMessage += `: has ${failedAssertions.length} failed assertions. Failing test suites: ${failed.length}/${total}.${jobLink}`;
58
+ slackMessage += `\n\n${failedAssertions[0]}`;
59
+ const blocks = failedAssertions.slice(1);
60
+ if (!repository) {
61
+ console.error(`Repository not provided, not sending slack notification`);
62
+ return;
63
+ }
64
+ // remove repository-owner part
65
+ const channel = `#notif-${repository.replace(/[^/]+\//, '')}`;
66
+ console.error(`Sending a notification to slack channel ${channel}`);
67
+ console.error('SLACK:', slackMessage);
68
+ console.error(' blocks:', blocks.join('\n'));
69
+ if (!dryRun) {
70
+ const slackToken = getEnvVar('SLACK_TOKEN_TESTS_BOT');
71
+ await sendSlackMessage(channel, slackMessage, blocks, slackToken);
72
+ }
73
+ };
74
+ //# sourceMappingURL=test-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-report.js","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAUvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACpC,MAAM,EACN,UAAU,EAAE,eAAe,EAC3B,MAAM,EACN,YAAY,EACZ,UAAU,GACa,EAAE,EAAE;IAC3B,MAAM,OAAO,GAAoB,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7F,MAAM,MAAM,GAA0B,EAAE,CAAC;IACzC,MAAM,MAAM,GAA0B,EAAE,CAAC;IAEzC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACxC,SAAS;QACb,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC5C,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,OAAO,CAAC,KAAK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C,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,UAAU,GAAG,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACtD,MAAM,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IACtE,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,88 @@
1
+ export interface Config {
2
+ targetBranch: string;
3
+ sourceBranch: string;
4
+ baseCommit?: string;
5
+ }
6
+ export type Commit = {
7
+ sha: string;
8
+ author: string;
9
+ date: string;
10
+ message: string;
11
+ };
12
+ export interface GitHubHeadCommit {
13
+ added: string[];
14
+ removed: string[];
15
+ modified: string[];
16
+ author: {
17
+ name: string;
18
+ };
19
+ message: string;
20
+ id: string;
21
+ }
22
+ export interface Repository {
23
+ full_name: string;
24
+ name: string;
25
+ ssh_url: string;
26
+ owner: {
27
+ login: string;
28
+ };
29
+ }
30
+ export type GitHubEvent = GitHubEventPullRequest | GitHubEventPush;
31
+ export type RawGitHubEvent = Partial<Omit<GitHubEventPullRequest, 'type'> & Omit<GitHubEventPush, 'type'>>;
32
+ export interface GitHubEventPullRequest {
33
+ type: 'pull_request';
34
+ pull_request: {
35
+ number: number;
36
+ base: {
37
+ ref: string;
38
+ sha: string;
39
+ };
40
+ head: {
41
+ ref: string;
42
+ sha: string;
43
+ };
44
+ };
45
+ repository: Repository;
46
+ }
47
+ export interface GitHubEventPush {
48
+ type: 'push';
49
+ head_commit: GitHubHeadCommit;
50
+ repository: Repository;
51
+ ref: string;
52
+ commits: GithubCommit[];
53
+ before: string;
54
+ after: string;
55
+ }
56
+ export interface GithubCommit {
57
+ id: string;
58
+ tree_id: string;
59
+ distinct: boolean;
60
+ message: string;
61
+ timestamp: string;
62
+ url: string;
63
+ author: {
64
+ name: string;
65
+ email: string;
66
+ username: string;
67
+ };
68
+ committer: {
69
+ name: string;
70
+ email: string;
71
+ username: string;
72
+ };
73
+ added: string[];
74
+ removed: string[];
75
+ modified: string[];
76
+ }
77
+ export interface BuildData {
78
+ buildId: string;
79
+ actorId: string;
80
+ actorName: string;
81
+ buildNumber: string;
82
+ }
83
+ export interface ActorConfig {
84
+ actorName: string;
85
+ folder: string;
86
+ isStandalone: boolean;
87
+ }
88
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../bin/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,MAAM,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAGD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAA;KACf,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE;QACH,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;CACJ;AAED,MAAM,MAAM,WAAW,GAAG,sBAAsB,GAAG,eAAe,CAAC;AAGnE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe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CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAA;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../bin/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import type { ActorConfig, GitHubEvent } from './types.js';
2
+ export declare const spawnCommandInGhWorkspace: (command: string, args?: string[]) => string;
3
+ export declare const getRepoName: (githubEvent: GitHubEvent) => string;
4
+ export declare const getEnvVar: (varName: string, defaultValue?: string) => string;
5
+ export declare const getRunUrlKvsKey: (runnerName: string) => string;
6
+ /**
7
+ * Reads and parses all directories in `actors` directory
8
+ * This works locally if checkoutRepoLocally is called first
9
+ */
10
+ export declare const getRepoActors: () => Promise<ActorConfig[]>;
11
+ export declare const getHeadCommitSha: (githubEvent: GitHubEvent) => string;
12
+ export interface GetChangedActorsResult {
13
+ actorsChanged: ActorConfig[];
14
+ codeChanged: boolean;
15
+ }
16
+ interface ShouldBuildAndTestOptions {
17
+ filepathsChanged: string[];
18
+ actorConfigs: ActorConfig[];
19
+ isLatest?: boolean;
20
+ }
21
+ /**
22
+ * Latest and devel are the same except that for latest we also rebuild with README and CHANGELOG files
23
+ */
24
+ export declare const getChangedActors: ({ filepathsChanged, actorConfigs, isLatest }: ShouldBuildAndTestOptions) => GetChangedActorsResult;
25
+ export {};
26
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../bin/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,WAAW,EACX,WAAW,EACd,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,yBAAyB,YAAa,MAAM,SAAQ,MAAM,EAAE,WAkBxE,CAAC;AAEF,eAAO,MAAM,WAAW,gBAAiB,WAAW,WAGnD,CAAC;AAEF,eAAO,MAAM,SAAS,YAAa,MAAM,iBAAiB,MAAM,KAAG,MAMlE,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,MAAM,WAEjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,WAAW,EAAE,CAgC3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAAiB,WAAW,WAIxD,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,yBAAyB;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAC;IAE5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AA2BD;;GAEG;AACH,eAAO,MAAM,gBAAgB,iDAC6B,yBAAyB,KAChF,sBAyEF,CAAC"}
@@ -0,0 +1,164 @@
1
+ import fs from 'node:fs/promises';
2
+ import { spawnSync } from 'node:child_process';
3
+ export const spawnCommandInGhWorkspace = (command, args = []) => {
4
+ console.error(command, args.join(' '));
5
+ const ghWorkspace = getEnvVar('GITHUB_WORKSPACE');
6
+ const commandInGhWorkspace = `cd ${ghWorkspace}; ${command}`;
7
+ const commandResult = spawnSync(commandInGhWorkspace, args, { shell: true, maxBuffer: 100 * 1024 * 1024 });
8
+ if (commandResult.error) {
9
+ throw new Error(`[Command failed]: ${commandInGhWorkspace}\n${commandResult.error}`);
10
+ }
11
+ if (commandResult.stderr.toString().length > 0) {
12
+ // For some reason 'git' command prints stderr when checking out to detached HEAD state (we only use detached HEAD for testing though)
13
+ if (!commandResult.stderr.toString().includes(`You are in 'detached HEAD' state`)) {
14
+ throw new Error(`[Command printed stderr]: ${commandInGhWorkspace}\n${commandResult.stderr.toString()}`);
15
+ }
16
+ }
17
+ return commandResult.stdout.toString().trim();
18
+ };
19
+ export const getRepoName = (githubEvent) => {
20
+ const [, repoName] = githubEvent.repository.full_name.split('/');
21
+ return repoName;
22
+ };
23
+ export const getEnvVar = (varName, defaultValue) => {
24
+ const value = process.env[varName] ?? defaultValue;
25
+ if (!value) {
26
+ throw new Error(`${varName} not defined`);
27
+ }
28
+ return value;
29
+ };
30
+ export const getRunUrlKvsKey = (runnerName) => {
31
+ return `RUN_URL-${runnerName}`;
32
+ };
33
+ /**
34
+ * Reads and parses all directories in `actors` directory
35
+ * This works locally if checkoutRepoLocally is called first
36
+ */
37
+ export const getRepoActors = async () => {
38
+ const ghWorkspace = getEnvVar('GITHUB_WORKSPACE');
39
+ let actorDirs;
40
+ try {
41
+ actorDirs = (await fs.readdir(`${ghWorkspace}/actors`)).map((dir) => `actors/${dir}`);
42
+ }
43
+ catch (err) {
44
+ console.warn(`No /actors directory found in repo`);
45
+ actorDirs = [];
46
+ }
47
+ let standaloneActorDirs;
48
+ try {
49
+ standaloneActorDirs = (await fs.readdir(`${ghWorkspace}/standalone-actors`)).map((dir) => `standalone-actors/${dir}`);
50
+ }
51
+ catch (err) {
52
+ console.warn(`No /standalone-actors directory found in repo`);
53
+ standaloneActorDirs = [];
54
+ }
55
+ const actorConfigs = [];
56
+ for (const actorDir of [...actorDirs, ...standaloneActorDirs]) {
57
+ const match = actorDir.match(/^([^/]+)\/(.+)_([^_]+)$/);
58
+ if (!match) {
59
+ throw new Error(`Invalid actor directory name. Got "${actorDir}", expected "actor.owner-name_actor-name"`);
60
+ }
61
+ const [, folderType, owner, actorName] = match;
62
+ actorConfigs.push({
63
+ actorName: `${owner}/${actorName}`,
64
+ folder: actorDir,
65
+ isStandalone: folderType === 'standalone-actors',
66
+ });
67
+ }
68
+ console.error(`Actors in repo: ${actorConfigs.filter(({ isStandalone }) => !isStandalone).map(({ actorName }) => actorName).join(', ')}`);
69
+ console.error(`Standalone actors in repo: ${actorConfigs.filter(({ isStandalone }) => !!isStandalone).map(({ actorName }) => actorName).join(', ')}`);
70
+ return actorConfigs;
71
+ };
72
+ export const getHeadCommitSha = (githubEvent) => {
73
+ return githubEvent.type === 'pull_request'
74
+ ? githubEvent.pull_request.head.sha
75
+ : githubEvent.head_commit.id;
76
+ };
77
+ /**
78
+ * Also works for folders
79
+ */
80
+ const isIgnoredTopLevelFile = (lowercaseFilePath) => {
81
+ // On top level, we should only have dev-only readme and .actor/ is just for apify push CLI (real Actor configs are in /actors)
82
+ const IGNORED_TOP_LEVEL_FILES = ['.vscode/', '.gitignore', 'readme.md', '.husky/', '.eslintrc', '.editorconfig', '.actor/'];
83
+ // Strip out deprecated /code and /shared folders, treat them as top-level code
84
+ const sanitizedLowercaseFilePath = lowercaseFilePath.replace(/^code\//, '').replace(/^shared\//, '');
85
+ return IGNORED_TOP_LEVEL_FILES.some((ignoredFile) => sanitizedLowercaseFilePath.startsWith(ignoredFile));
86
+ };
87
+ const isLatestBuildOnlyFile = (lowercaseFilePath) => {
88
+ if (lowercaseFilePath.endsWith('changelog.md')) {
89
+ return true;
90
+ }
91
+ // Either in /actors or /standalone-actors, we need to rebuild readme but we don't rebuild top-level dev-only readme
92
+ if ((lowercaseFilePath.startsWith('actors/') || lowercaseFilePath.startsWith('standalone-actors/')) && lowercaseFilePath.endsWith('readme.md')) {
93
+ return true;
94
+ }
95
+ return false;
96
+ };
97
+ /**
98
+ * Latest and devel are the same except that for latest we also rebuild with README and CHANGELOG files
99
+ */
100
+ export const getChangedActors = ({ filepathsChanged, actorConfigs, isLatest = false }) => {
101
+ let codeChanged = false;
102
+ // folder -> ActorConfig
103
+ const actorsChangedMap = new Map();
104
+ const actorConfigsWithoutStandalone = actorConfigs.filter(({ isStandalone }) => !isStandalone);
105
+ const lowercaseFiles = filepathsChanged.map((file) => file.toLowerCase());
106
+ for (const lowercaseFilePath of lowercaseFiles) {
107
+ if (isIgnoredTopLevelFile(lowercaseFilePath)) {
108
+ continue;
109
+ }
110
+ // First we check for specific actors that have configs in /actors or standalone actors in /standalone-actors
111
+ // This matches both actors/username_actorName and standalone-actors/username_actorName
112
+ const changedActorConfigMatch = lowercaseFilePath.match(/^(?:standalone-)?actors\/([^/]+)\/.+/);
113
+ if (changedActorConfigMatch) {
114
+ const sanitizedActorName = changedActorConfigMatch[1].replace('_', '/');
115
+ const actorConfigChanged = actorConfigs.find(({ actorName }) => actorName.toLowerCase() === sanitizedActorName);
116
+ if (actorConfigChanged === undefined) {
117
+ console.warn('changes was found in an actor folder which no longer exists in the current commit', {
118
+ actorName: sanitizedActorName,
119
+ actorFolderName: changedActorConfigMatch[1],
120
+ });
121
+ continue;
122
+ }
123
+ console.error(`actorConfigChanged ${actorConfigChanged.actorName}: sanitizedActorName ${sanitizedActorName} ${lowercaseFilePath} `);
124
+ // These can be nested at various folders inside the actor folder
125
+ if (isLatest || !isLatestBuildOnlyFile(lowercaseFilePath)) {
126
+ // We assume other files will are either actor.json or input_schema.json and those needs to be tested
127
+ // TODO: Check what changed in schema, we don't need to test description changes
128
+ actorsChangedMap.set(actorConfigChanged.folder, actorConfigChanged);
129
+ }
130
+ continue;
131
+ }
132
+ // We check top level files (formerly in /code and /shared folders) that are shared among all non-standalone Actors
133
+ // Standalone actors are always handled separately by name via changedActorConfigMatch
134
+ if (isLatest || !isLatestBuildOnlyFile(lowercaseFilePath)) {
135
+ codeChanged = !isLatest; // NOTE: code is changed only in PR
136
+ for (const actorConfig of actorConfigsWithoutStandalone) {
137
+ actorsChangedMap.set(actorConfig.folder, actorConfig);
138
+ }
139
+ }
140
+ }
141
+ const actorsChanged = Array.from(actorsChangedMap.values());
142
+ // All below here is just for logging
143
+ const ignoredFilesChanged = lowercaseFiles.filter((file) => isIgnoredTopLevelFile(file));
144
+ console.error(`[DIFF]: Top level files changed that we ignore (don't trigger test or build): ${ignoredFilesChanged.join(', ')}`);
145
+ const onlyLatestFilesChanged = lowercaseFiles.filter((file) => isLatestBuildOnlyFile(file));
146
+ console.error(`[DIFF]: Files changed that only trigger latest build: ${onlyLatestFilesChanged.join(', ')}`);
147
+ if (!isLatest && codeChanged) {
148
+ console.error(`[DIFF]: All non-standalone Actors need to be built and tested (changes in top-level code)`);
149
+ }
150
+ if (actorsChanged.length > 0) {
151
+ const miniactors = actorsChanged.filter((config) => !config.isStandalone).map((config) => config.actorName);
152
+ const standaloneActors = actorsChanged.filter((config) => config.isStandalone).map((config) => config.actorName);
153
+ console.error(`[DIFF]: MiniActors to be built and tested: ${miniactors.join(', ')}`);
154
+ console.error(`[DIFF]: Standalone Actors to be built and tested: ${standaloneActors.join(', ')}`);
155
+ }
156
+ else {
157
+ console.error(`[DIFF]: No relevant files changed, skipping builds and tests`);
158
+ }
159
+ return {
160
+ actorsChanged,
161
+ codeChanged,
162
+ };
163
+ };
164
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../bin/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAe,EAAE,OAAiB,EAAE,EAAE,EAAE;IAC9E,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,MAAM,WAAW,KAAK,OAAO,EAAE,CAAC;IAC7D,MAAM,aAAa,GAAG,SAAS,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;IAE3G,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,qBAAqB,oBAAoB,KAAK,aAAa,C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,0 +1,3 @@
1
+ export { describe, testActor, ExpectStatic } from './lib/lib.js';
2
+ export { RunTestResult } from './lib/run-test-result.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { describe, testActor } from './lib/lib.js';
2
+ export { RunTestResult } from './lib/run-test-result.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToFinishWithOptionsWithDefaults } from './types';
2
+ export declare const TO_FINISH_WITH_OPTIONS: ToFinishWithOptionsWithDefaults;
3
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,sBAAsB,EAAE,+BAYpC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const TO_FINISH_WITH_OPTIONS = {
2
+ status: 'SUCCEEDED',
3
+ duration: {
4
+ min: 600, // 0.6 sec
5
+ max: 600_000, // 10 min
6
+ },
7
+ failedRequests: 0,
8
+ requestsRetries: { max: 3 },
9
+ forbiddenLogs: [
10
+ 'ReferenceError',
11
+ 'TypeError',
12
+ ],
13
+ };
14
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAoC;IACnE,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE;QACN,GAAG,EAAE,GAAG,EAAE,UAAU;QACpB,GAAG,EAAE,OAAO,EAAE,SAAS;KAC1B;IACD,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;IAC3B,aAAa,EAAE;QACX,gBAAgB;QAChB,WAAW;KACd;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ExpectStatic } from 'vitest';
2
+ export declare const extendExpect: (expect: ExpectStatic) => ExpectStatic;
3
+ //# sourceMappingURL=extend-expect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend-expect.d.ts","sourceRoot":"","sources":["../../lib/extend-expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtD,eAAO,MAAM,YAAY,WAAY,YAAY,KAAG,YAmOnD,CAAC"}