Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Test URL check to Vitest #7694

Merged
merged 9 commits into from
Aug 27, 2024
Merged

Move Test URL check to Vitest #7694

merged 9 commits into from
Aug 27, 2024

Conversation

fregante
Copy link
Member

@fregante fregante commented Aug 17, 2024

@fregante fregante added the meta Related to Refined GitHub itself label Aug 17, 2024
LAST_LINE=$(wc -l < "$FILE")
if grep -q "test url" -i "$FILE"; then
echo ✅ "$FILE"
echo "::notice file=$FILE,line=$LAST_LINE::✅" >> "$ANNOTATIONS"
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be nice to still output this positive annotation on all files though, just to bring the test URLs to light when reviewing, but it seems it's already not working?

@fregante
Copy link
Member Author

Oof, vitest looks so good 🥹 it groups errors by type and I can click each filename in the terminal to reach them.

Screenshot 9


The section must be appended to each .tsx file:

/*
Copy link
Member Author

Choose a reason for hiding this comment

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

I need to restore this message too, to help user document new features. The message needs to be updated.

@fregante
Copy link
Member Author

Current output, waiting for:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 21 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  build/features.test.ts > features > center-reactions-popup.css
 FAIL  build/features.test.ts > features > clean-conversations.css
 FAIL  build/features.test.ts > features > clean-notifications.css
 FAIL  build/features.test.ts > features > github-bugs.css
 FAIL  build/features.test.ts > features > repo-stats-spacing.css
 FAIL  build/features.test.ts > features > safer-destructive-actions.css
AssertionError: Should have test URLs
 ❯ validateCss build/features.test.ts:109:3
    107|   );
    108| 
    109|   assert(/test url/i.test(file.contents().toString()), 'Should have test URLs');
       |   ^
    110|   return;
    111|  }
 ❯ build/features.test.ts:199:4

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/21]⎯

 FAIL  build/features.test.ts > features > command-palette-navigation-shortcuts.tsx
 FAIL  build/features.test.ts > features > comment-fields-keyboard-shortcuts.tsx
 FAIL  build/features.test.ts > features > convert-pr-to-draft-improvements.tsx
 FAIL  build/features.test.ts > features > cross-deleted-pr-branches.tsx
 FAIL  build/features.test.ts > features > emphasize-draft-pr-label.tsx
 FAIL  build/features.test.ts > features > esc-to-cancel.tsx
 FAIL  build/features.test.ts > features > esc-to-deselect-line.tsx
 FAIL  build/features.test.ts > features > hide-newsfeed-noise.tsx
 FAIL  build/features.test.ts > features > html-preview-link.tsx
 FAIL  build/features.test.ts > features > improve-shortcut-help.tsx
 FAIL  build/features.test.ts > features > linkify-labels-on-dashboard.tsx
 FAIL  build/features.test.ts > features > one-key-formatting.tsx
 FAIL  build/features.test.ts > features > patch-diff-links.tsx
 FAIL  build/features.test.ts > features > prevent-duplicate-pr-submission.tsx
 FAIL  build/features.test.ts > features > prevent-pr-merge-panel-opening.tsx
AssertionError: Should have test URLs
 ❯ validateTsx build/features.test.ts:162:2
    160|  );
    161| 
    162|  assert(/test url/i.test(file.contents().toString()), 'Should have test URLs');
       |  ^
    163| 
    164|  if (file.contents().includes('.addCssFeature')) {
 ❯ build/features.test.ts:204:4

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/21]⎯

@fregante fregante marked this pull request as ready for review August 27, 2024 07:39
@fregante fregante merged commit ba1bdbf into main Aug 27, 2024
10 checks passed
@fregante fregante deleted the vitest-URLs branch August 27, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to Refined GitHub itself
Development

Successfully merging this pull request may close these issues.

1 participant