Skip to content

chore(repo): Test task cache, instance cleanup - #4385

Merged
brkalow merged 2 commits into
mainfrom
brk.chore/repo-integration-tests-cache
Oct 29, 2024
Merged

chore(repo): Test task cache, instance cleanup#4385
brkalow merged 2 commits into
mainfrom
brk.chore/repo-integration-tests-cache

Conversation

@brkalow

@brkalow brkalow commented Oct 23, 2024

Copy link
Copy Markdown
Member

Description

Fixes caching for integration test tasks, all task dependencies incorrectly contained ^, which means the task should depend on its package's dependencies running the tasks specified with ^. This was effectively a no-op when used for a root task with package-specific tasks in its dependencies. This should fix integration test caching 🤞

Also fixes an issue with the integration test cleanup script where not all instances were being cleaned up.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Oct 23, 2024

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2218b51

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@brkalow brkalow changed the title chore(repo): test task cache, instance cleanup chore(repo): Test task cache, instance cleanup Oct 23, 2024

@panteliselef panteliselef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for dropping apiUrl. Unused property ?

Comment thread .github/workflows/ci.yml
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_LONG && fromJSON(vars.TIMEOUT_MINUTES_LONG) || 15 }}

strategy:
fail-fast: false

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the flakiness of our integration tests, it feels valuable to continue running tests even if others fail. Many times tests are minutes into running when cancelled, which I don't think has the cost savings we expect in practice.

if (!secretKey) {
return null;
}
return { secretKey, apiUrl: json.private['CLERK_API_URL'] };

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiUrl seemed unused as far as I can tell, or at least not changed from the default.

import { appConfigs } from '../presets/';

setup('cleanup instances ', async () => {
const entries = Object.values(appConfigs.envs)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appConfig.envs didn't contain all the keys in use, so not all instances were getting cleaned up as far as I could tell.

Comment thread turbo.json
},
"//#test:integration:ap-flows": {
"dependsOn": ["^@clerk/clerk-js#build", "^@clerk/backend#build", "^@clerk/nextjs#build"],
"dependsOn": ["@clerk/clerk-js#build", "@clerk/backend#build", "@clerk/nextjs#build"],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the adjustments here remove the ^ for each dependency. The ^ says to wait on the package's dependencies, which for a root task like this effectively seems like a no-op.

I've validated that this properly caches the integration test run only if the dependent build steps remain unchanged, which is the desired behavior.

@brkalow
brkalow requested a review from panteliselef October 29, 2024 14:12

@anagstef anagstef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@brkalow
brkalow merged commit 341fcd6 into main Oct 29, 2024
@brkalow
brkalow deleted the brk.chore/repo-integration-tests-cache branch October 29, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants