Improve performance and change var name

1. Fetch meta data only once
2. Change "recordTestRun" to "updateTestRunHistory"