Upper endoscopy is a test that looks inside the upper gastrointestinal, or GI tract. The GI tract includes the esophagus, stomach, and the duodenum, which is the first part of the small intestine.