I flew a group aircraft for a pre-purchase test flight a few weeks back. It was agreed before the flight that I wasn't PIC and I wouldn't be logging it, although I was the only person who touched the controls.
I made a record of the flight on one of the "notes" pages in my log book, with a statement that I wasn't PIC.