Tests for scripted metric aggregation