shortest icon indicating copy to clipboard operation
shortest copied to clipboard

refactor(config): update config to detect test.ts files instead of files under test dir

Open khalatevarun opened this issue 11 months ago • 4 comments

Fix: #190

khalatevarun avatar Dec 27 '24 23:12 khalatevarun

@khalatevarun is attempting to deploy a commit to the Antiwork Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 27 '24 23:12 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shortest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 29, 2024 9:56am

vercel[bot] avatar Dec 27 '24 23:12 vercel[bot]

Lint and shortest tests are failing

slavingia avatar Dec 27 '24 23:12 slavingia

May also want to version this as a breaking change. Can be minor as small and early

slavingia avatar Dec 28 '24 00:12 slavingia

Shortest workflow is failing with this error. I am getting a similar issue locally. Another issue that came up is when deleting node_modules and building and installing the package again, some of the packages are not resolving properly. Shown in the last image below.

image

image

m2rads avatar Dec 29 '24 11:12 m2rads

^ our fault? I still think we should remove pnpm and go to npm.

If someone else could replicate that and fix, would be great. Don't think anything in this branch would cause it, and someone else reported that there may be inconsistencies in the node modules based on npx vs using pnpm in places.

slavingia avatar Dec 29 '24 13:12 slavingia

How does this work if there's a set of tests I don't want to run, or a folder I only want to run tests for, temporarily (via CLI)?

slavingia avatar Dec 29 '24 13:12 slavingia

image

I can see a call to getConfig here in bin.ts -> main, before the initialize is called.

and getConfig throws if the globalConfig is not present.

image

but anything changed recently on this logic ?

amk-dev avatar Dec 29 '24 13:12 amk-dev

Another issue that came up is when deleting node_modules and building and installing the package again, some of the packages are not resolving properly. Shown in the last image below.

I tried reproducing this, but no luck. here are the steps i took,

  1. removed node_modules from packages/shortest & root node_modules
  2. pnpm i at the workspace root

no issue with the imports. may be you can try reloading vscode and see it it fixs the issue. ( Cmd+Shift+P -> Developer: Relaod Window ), sometimes it happens.

amk-dev avatar Dec 29 '24 14:12 amk-dev

Just posting it here again in case you missed it:

You're right. with the new implementation we should first initialize the runner and then initialize the config: This should fix it:


  try {
    const runner = new TestRunner(
      process.cwd(),
      true,
      headless,
      targetUrl,
      debugAI
    );
    await runner.initialize();

    const config = getConfig();
    const testPattern = cliTestPattern || config.testPattern;

    await runner.runTests(testPattern);
  }

Let me know if you need the full code for this.

Another issue that came up is when deleting node_modules and building and installing the package again, some of the packages are not resolving properly. Shown in the last image below.

I tried reproducing this, but no luck. here are the steps i took,

  1. removed node_modules from packages/shortest & root node_modules
  2. pnpm i at the workspace root

no issue with the imports. may be you can try reloading vscode and see it it fixs the issue. ( Cmd+Shift+P -> Developer: Relaod Window ), sometimes it happens.

m2rads avatar Dec 30 '24 08:12 m2rads

Please merge main to include a new caching feature!

slavingia avatar Dec 30 '24 19:12 slavingia

Would be great to merge this soon so I can use this new approach :)

slavingia avatar Dec 31 '24 16:12 slavingia

Would be great to get to this soon. If it's not done by Friday we'll have some internally do it as I think this is quite important!

slavingia avatar Dec 31 '24 17:12 slavingia

Would be great to get to this soon. If it's not done by Friday we'll have some internally do it as I think this is quite important!

Updated the branch and resolved the issue.

m2rads avatar Jan 02 '25 00:01 m2rads