I saw this firsthand as an undergrad research assistant in a neuroscience lab. How did it go when I brought it up? Swept under the rug and published in a high-impact journal.
Moreover, the lab pushed me out and decided to use my work anyway. Specifically, they requested that anybody that used the software I wrote give them authorship on their papers.
I'm happily employed as a software engineer now.