fix cpi external test variable context scope