Prepare pasta according to package directions. Drain and set aside covered.
Heat 1 tablespoon of olive oil in a large skillet over medium. Dice chicken into 1 inch cubes and season with salt and pepper. Add to hot skillet and cook for 3-4 minutes, turning to brown all sides.
While chicken is cooking, chop onion and mince garlic; remove chicken from skillet and set aside on a plate.
Heat remaining tablespoon of olive oil in same skillet. Add onion and garlic and cook for 2-3 minutes. Add sliced mushrooms, thyme, oregano, and sun-dried tomatoes. Toss to coat with spices, and then cook for 2 minutes.
Drain and rinse beans, add to skillet along with canned tomatoes, chili flakes (optional), sugar, and parsley. Stir, and add chicken back to skillet. Cover and cook until bubbly and chicken is cooked through.