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

adopt Ava default file glob #8653

Merged
merged 48 commits into from
May 9, 2024
Merged

adopt Ava default file glob #8653

merged 48 commits into from
May 9, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Dec 13, 2023

closes: #8273

Description

Adds a script to migrate a package's file glob to the Ava defaults. See script docs and #8273 for motivation. It uses https://github.com/google/zx because I was banging my head on Bash options and version inconsistencies.

The main thing to review is whether this change is good. Then the code in the first commit. The subsequent commits just are the code running over all the packages. When this PR is approved I'll rebase and re-run the batch to make all the migration commits anew.

Once this is in SDK, we can do the same in other Agoric repos.

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

If anything, less need for documentation because it aligns with how Ava works by default.

Testing Considerations

To run the script yourself, ensure,

npm install -g zx

Upgrade Considerations

n/a

@turadg turadg force-pushed the ta/migrate-test-names branch 2 times, most recently from 45c6d7e to d86551c Compare December 14, 2023 18:32
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

With

Once this is in SDK, we can do the same in other Agoric repos.

in the PR comment, this PR LGTM. However, I'd like to see such a PR actually happen and be approved for endo before seeing both merged. After a month of unanticipated pain bringing our two main repos back in sync, the last thing I want to see is for them to diverge again. This makes it hazardous to merge either until both are approved.

See endojs/endo#1913

@Chris-Hibbert
Copy link
Contributor

I think the script will mis-handle generated snapshots. The old file name appears in the file, and probably needs to be corrected so new generated files will match.

@turadg
Copy link
Member Author

turadg commented May 9, 2024

I think the script will mis-handle generated snapshots. The old file name appears in the file, and probably needs to be corrected so new generated files will match.

Good catch. I'll regenerate them and delete the old one.

Copy link

cloudflare-workers-and-pages bot commented May 9, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9b8865f
Status: ✅  Deploy successful!
Preview URL: https://ccc6109c.agoric-sdk.pages.dev
Branch Preview URL: https://ta-migrate-test-names.agoric-sdk.pages.dev

View logs

@turadg turadg force-pushed the ta/migrate-test-names branch 3 times, most recently from 6ee4f59 to a8ace47 Compare May 9, 2024 18:46
@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label May 9, 2024
@turadg
Copy link
Member Author

turadg commented May 9, 2024

@Mergifyio queue

Copy link
Contributor

mergify bot commented May 9, 2024

queue

🟠 Waiting for conditions to match

  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue main]
      • #approved-reviews-by>=1 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0 [🛡 GitHub branch protection]
      • any of: [🛡 GitHub branch protection]
        • check-success=gotest
        • check-neutral=gotest
        • check-skipped=gotest
      • any of: [🛡 GitHub branch protection]
        • check-success=lint
        • check-neutral=lint
        • check-skipped=lint
      • any of: [🛡 GitHub branch protection]
        • check-success=test-quick (xs)
        • check-neutral=test-quick (xs)
        • check-skipped=test-quick (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-quick2 (xs)
        • check-neutral=test-quick2 (xs)
        • check-skipped=test-quick2 (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-cosmic-swingset (xs)
        • check-neutral=test-cosmic-swingset (xs)
        • check-skipped=test-cosmic-swingset (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset (xs)
        • check-neutral=test-swingset (xs)
        • check-skipped=test-swingset (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset2 (xs)
        • check-neutral=test-swingset2 (xs)
        • check-skipped=test-swingset2 (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset3 (xs)
        • check-neutral=test-swingset3 (xs)
        • check-skipped=test-swingset3 (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset4 (xs)
        • check-neutral=test-swingset4 (xs)
        • check-skipped=test-swingset4 (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-zoe-swingset (xs)
        • check-neutral=test-zoe-swingset (xs)
        • check-skipped=test-zoe-swingset (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-zoe-unit (xs)
        • check-neutral=test-zoe-unit (xs)
        • check-skipped=test-zoe-unit (xs)
      • any of: [🛡 GitHub branch protection]
        • check-success=lint-primary
        • check-neutral=lint-primary
        • check-skipped=lint-primary
      • any of: [🛡 GitHub branch protection]
        • check-success=lint-rest
        • check-neutral=lint-rest
        • check-skipped=lint-rest
      • any of: [🛡 GitHub branch protection]
        • check-success=build (18.x)
        • check-neutral=build (18.x)
        • check-skipped=build (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-cosmic-swingset (18.x)
        • check-neutral=test-cosmic-swingset (18.x)
        • check-skipped=test-cosmic-swingset (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-quick (18.x)
        • check-neutral=test-quick (18.x)
        • check-skipped=test-quick (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset (18.x)
        • check-neutral=test-swingset (18.x)
        • check-skipped=test-swingset (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-quick2 (18.x)
        • check-neutral=test-quick2 (18.x)
        • check-skipped=test-quick2 (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-solo (18.x)
        • check-neutral=test-solo (18.x)
        • check-skipped=test-solo (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-zoe-unit (18.x)
        • check-neutral=test-zoe-unit (18.x)
        • check-skipped=test-zoe-unit (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-zoe-swingset (18.x)
        • check-neutral=test-zoe-swingset (18.x)
        • check-skipped=test-zoe-swingset (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset2 (18.x)
        • check-neutral=test-swingset2 (18.x)
        • check-skipped=test-swingset2 (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset3 (18.x)
        • check-neutral=test-swingset3 (18.x)
        • check-skipped=test-swingset3 (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-swingset4 (18.x)
        • check-neutral=test-swingset4 (18.x)
        • check-skipped=test-swingset4 (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-inter-protocol (18.x)
        • check-neutral=test-inter-protocol (18.x)
        • check-skipped=test-inter-protocol (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-skipped=linear-history
        • check-neutral=linear-history
        • check-success=linear-history
      • any of: [🛡 GitHub branch protection]
        • check-success=merge-strategy (chosen)
        • check-neutral=merge-strategy (chosen)
        • check-skipped=merge-strategy (chosen)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-boot (18.x)
        • check-neutral=test-boot (18.x)
        • check-skipped=test-boot (18.x)
      • any of: [🛡 GitHub branch protection]
        • check-success=test-boot (xs)
        • check-neutral=test-boot (xs)
        • check-skipped=test-boot (xs)
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success=Configuration changed

@turadg
Copy link
Member Author

turadg commented May 9, 2024

@Mergifyio refresh

Copy link
Contributor

mergify bot commented May 9, 2024

refresh

✅ Pull request refreshed

Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

Looks good.

@turadg
Copy link
Member Author

turadg commented May 9, 2024

@Mergifyio queue

Copy link
Contributor

mergify bot commented May 9, 2024

queue

🛑 Invalid queue name

The queue default does not exist

@mergify mergify bot merged commit 822ab08 into master May 9, 2024
63 checks passed
@mergify mergify bot deleted the ta/migrate-test-names branch May 9, 2024 21:01
turadg added a commit to endojs/endo that referenced this pull request May 9, 2024
Refs: Agoric/agoric-sdk#8273

## Description

Akin to Agoric/agoric-sdk#8653

### Security Considerations

none

### Scaling Considerations

none

### Documentation Considerations

reduces need to document differences

### Testing Considerations

CI

### Compatibility Considerations

Developers will need to know to make the new files. This globs for both
old and new so no tests are accidentally omitted from CI.
Agoric/agoric-sdk#8273 will be closed by
dropping the custom glob and ensuring no old names remain.

### Upgrade Considerations

none
mergify bot added a commit that referenced this pull request May 28, 2024
closes: #8273

## Description

#8653 adopted the new glob but
left the old one so any in-flight PRs with new tests wouldn't have them
ignored.

It's been a month so any should be migrated by now. This removes the old
glob.

It doesn't remove the `"files"` option entirely, because the default
glob is everything under `test` and we have files there that aren't
tests. Ava warns they're not tests and and eslint errors when tests
import from them. We could go fully to the default glob by using an
underscore prefixes on files in `test` that aren't tests. I don't think
we need to do that. This change already meets the goal of matching the
DX of Ava in other repos. (Test filenames are indicated by a `.test.js`
suffix)

### Security Considerations
n/a


### Scaling Considerations
n/a

### Documentation Considerations

reduces need to document

### Testing Considerations

no older test files in master (`find packages -name 'test-*' |grep
'test/'`)

### Upgrade Considerations

n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adopt Ava default files glob
3 participants