Easy-Transformer icon indicating copy to clipboard operation
Easy-Transformer copied to clipboard

[Bug Report] Test coverage missing on add_hook in hook_points

Open bryce13950 opened this issue 1 year ago • 2 comments

Originally noted by @VasilGeorgiev39 while refactoring add_hook functions.

Thanks for merging! I also just checked it and seems good to me too. Actually it seemed to me that initially I made a mistake in add_hook where in the 'prepend' case I was always adding the hook to the forward hooks but you have fixed this, thanks. I am actually surprised that no tests caught this?

Originally posted by @VasilGeorgiev39 in https://github.com/neelnanda-io/TransformerLens/issues/505#issuecomment-2053758445

Describe the bug The coverage needs to be improved, so that any further changes to this area can be tested properly in order to avoid bugs being introduced into the main branch.

bryce13950 avatar Apr 15 '24 19:04 bryce13950

I can work on this today.

anthonyduong9 avatar May 27 '24 23:05 anthonyduong9

@anthonyduong9 I just did something similar to this on a different part of the same file https://github.com/TransformerLensOrg/TransformerLens/pull/613/files. It was a lot easier to test the bit of code I tested by breaking it down into simpler functions. When you are doing this, if you are struggling to find an easy way to test things in isolation, breaking it out a bit might be something worth considering.

bryce13950 avatar May 27 '24 23:05 bryce13950