The unit tests were failing because the upgrade step was missed. In addition, there was a typo in a variable name, which meant that the role was not actually synchronised.