Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: correctly detect conflicting function names consistently #1258

Merged
merged 2 commits into from
Nov 7, 2022
Merged

Conversation

danez
Copy link
Contributor

@danez danez commented Nov 4, 2022

Summary

I was investigating why the tests fail sometimes. The tests ensure that when multiple files for the same function exist we always use the same order in how we detect them.

My first thought was it has to do with async stuff in the tests, just to figure out during my perf change I did change locate-path to not preserve order, which triggers this flaky behavior.

This reverts this change, plus some additional fixes for the tests, I run into on the way.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code πŸ§‘β€πŸ’».
    This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing
    a typo or something that`s on fire πŸ”₯ (e.g. incident related), you can skip this step.
  • Read the contribution guidelines πŸ“–. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) πŸ§ͺ
  • Update or add documentation (if features were changed or added) πŸ“
  • Make sure the status checks below are successful βœ…

A picture of a cute animal (not mandatory, but encouraged)

@danez danez requested a review from a team November 4, 2022 13:34
@danez danez self-assigned this Nov 4, 2022
@@ -47,6 +47,8 @@ export const zipFixture = async function (
const bundlerString = getBundlerNameFromConfig(config) || 'default'
const { path: tmpDir } = await getTmpDir({
prefix: `zip-it-test-bundler-${bundlerString}`,
// Cleanup the folder on process exit even if there are still files in them
unsafeCleanup: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We never clean the temp folders, because there are still files left in them. With this change we do force remove the tmp folders on process exit.

@@ -73,7 +73,7 @@ export const makeTestMany = <M extends string>(
const testFns = ['fails', 'only', 'concurrent', 'skip', 'todo']

testFns.forEach((fn) => {
testBundlers[fn] = ((...args) => testBundlers(...args, test[fn])) as TestMany<M>
testBundlers[fn] = ((...args) => testBundlers(...args, testAPI[fn])) as TestMany<M>
Copy link
Contributor Author

@danez danez Nov 4, 2022

Choose a reason for hiding this comment

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

This does not really mattter, but it is cleaner to use the testAPI that is supplied to the makeTestMany() which is also test, instead of using test directly.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

⏱ Benchmark results

Comparing with a7517a7

largeDepsEsbuild: 3.1s

⬆️ 0.70% increase vs. a7517a7

^                                                                    3s     3.1s  
β”‚                                                   2.9s            β”Œβ”€β”€β”    β”Œβ”€β”€β”  
β”‚                                                   β”Œβ”€β”€β”            |  |    |β–’β–’|  
β”‚           2.6s                                    |  |            |  |    |β–’β–’|  
β”‚ β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€2.5s────────────────────┼──┼────2.5s────┼──┼────|β–’β–’|──
β”‚           |  |            β”Œβ”€β”€β”            2.2s    |  |    β”Œβ”€β”€β”    |  |    |β–’β–’|  
β”‚   2.1s    |  |    2.1s    |  |    2.1s    β”Œβ”€β”€β”    |  |    |  |    |  |    |β–’β–’|  
β”‚   β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsNft: 15s

⬇️ 3.12% decrease vs. a7517a7

^                                                                  15.5s          
β”‚                                                  14.8s            β”Œβ”€β”€β”    15s   
β”‚          14.2s                                    β”Œβ”€β”€β”            |  |    β”Œβ”€β”€β”  
β”‚           β”Œβ”€β”€β”                                    |  |            |  |    |β–’β–’|  
β”‚           |  |           12.4s                    |  |            |  |    |β–’β–’|  
β”‚ β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€11.9s────┼──┼────|β–’β–’|──
β”‚           |  |            |  |            11s     |  |    β”Œβ”€β”€β”    |  |    |β–’β–’|  
β”‚           |  |    9.8s    |  |   10.1s    β”Œβ”€β”€β”    |  |    |  |    |  |    |β–’β–’|  
β”‚   9.4s    |  |    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsZisi: 21.6s

⬇️ 4.32% decrease vs. a7517a7

^                                                                  22.5s          
β”‚                                                  21.3s            β”Œβ”€β”€β”   21.6s  
β”‚                                                   β”Œβ”€β”€β”            |  |    β”Œβ”€β”€β”  
β”‚          19.7s           18.6s                    |  |            |  |    |β–’β–’|  
β”‚           β”Œβ”€β”€β”            β”Œβ”€β”€β”                    |  |    18s     |  |    |β–’β–’|  
β”‚ β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€|β–’β–’|──
β”‚           |  |            |  |           16.1s    |  |    |  |    |  |    |β–’β–’|  
β”‚  14.5s    |  |   15.1s    |  |   15.1s    β”Œβ”€β”€β”    |  |    |  |    |  |    |β–’β–’|  
β”‚   β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@danez danez merged commit e7e3eb5 into main Nov 7, 2022
@danez danez deleted the fix-files branch November 7, 2022 10:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants