Preheat oven to 425°F (220°C). On a baking sheet, combine tomatoes, mushrooms, and chopped onion. Drizzle with 1 tbsp olive oil and sprinkle with 1/2 tsp salt. Roast for 20 minutes, until veggies are tender and slightly browned.
Meanwhile, cook spaghetti according to package directions until al dente. Reserve 1/2 to 1 cup of the pasta water before draining. Toss drained pasta with a little butter or olive oil to prevent sticking.
Transfer the roasted vegetables to a food processor. Add the canned diced tomatoes, garlic cloves, another 1/2 tsp salt, pitted olives, 1 tbsp olive oil, and a squeeze of lemon juice. Pulse until a textured sauce forms. Taste and adjust seasoning.
Return the drained pasta to its pot. Add the textured sauce to the pasta. Toss to combine. Stir in butter. Add reserved pasta water, a little at a time, until the sauce is very saucy and coats the pasta beautifully. Serve immediately with fresh basil or Parmesan, if desired.