For the tomatoes, preheat the oven to 150C/300F/Gas 2.
Place the tomatoes, cut-side up, onto a roasting tray.
Sprinkle with the thyme, salt and freshly ground black pepper, to taste, and olive oil.
Roast for 1-2 hours until the moisture has mainly evaporated and the tomatoes have dried out.
Remove the tomatoes from the oven and set aside to cool.
For the pesto, place all the ingredients, except the oil and seasoning, into a pestle and mortar or food processor and blend to a coarse purée. Then gradually add the oil, continuing to blend until you have a thick purée.
Season the pesto to taste with salt and freshly ground black pepper.
For the tart, preheat the oven to 200C/400F/Gas 6.
Heat two small (18-20cm/7-8in) ovenproof frying pans over a medium heat and add a few tablespoons of olive oil to each.
Arrange the sliced potatoes in just overlapping circles so they cover the bottom of the pans.
Season with salt and freshly ground black pepper and reduce the heat to low.
Cook for about five minutes until the potatoes turn golden brown on the edges and are translucent in the middle.
Spread the rocket pesto over the potato layer.
Place the sardines on top, with the tail pointing towards the middle, in a fan shape around the pan then sprinkle the oregano over the top.
Place the pans in the oven and bake for 15-20 minutes until golden brown on the base.
When the potatoes are cooked and the top is golden brown, remove the tarts from the oven and cool slightly before tipping out of the pan.
Meanwhile, heat a frying pan with about 2cm/1in of vegetable oil, until just shimmering.
Add the capers and cook until crispy then remove and drain onto kitchen paper.
To serve, place each tart onto a serving plate and place a few roasted tomatoes on top. Finish with some of the deep-fried capers and pecorino shavings.