Virat Kohli ended his Test career on Monday as India's fourth-highest run-getter in the format, ending days of speculation about his future.