The English longbow wasn't particularly effective against heavily armoured cavalry. After all, a major role for the armour was to stop arrows. If, in addition to the riders being armoured, the horses were armoured, they would be well-protected against archery.
Even when the horses were unarmoured, cavalry were still fast enough to cross the distance over which archery was effective so that the archers would usually only be able to shoot once (twice if they first shot at extreme range). When longbowmen were unprotected by field fortifications or a screen of armoured infantry, cavalry would typically reach them and defeat them in close combat. For example, at Bannockburn, the English archers were left unprotected, and the Scottish cavalry put them out of the battle. In the Hundred Years War, in the Battle of Patay (1429), French cavalry caught the English archers unprotected. In the Battle of Formigny (1450), the English fared well against a smaller French army when protected by their field fortifications. When they left their fortified position to capture French artillery, they were attacked by Breton cavalry who had just arrived to reinforce the French, which led to the destruction of the English army.
Armoured infantry were also well-protected against archery. The bow was a common weapon on the battlefield, and armour worth wearing tended to stop arrows reasonably well. Typically, helmets and torso armour (e.g., breastplates) was made strong enough to stop arrows, while arm and leg armour was often thinner (to save weight, in areas where arrows would not be so deadly). This meant that to have much effect on armoured troops, archers would need to shoot repeatedly, which required protection against the enemy closing with them, and also a large supply of arrows.
Given that required protection against closing in the form of a screen of armoured infantry and/or field fortifications, archers could do a lot of damage, especially to unarmoured infantry and cavalry without armoured horses. This wouldn't necessarily mean piles of enemy dead killed by the archers! At the Battle of Crécy (1346), the English archers were issued 72 arrows each, and almost all of those arrows were shot in the battle (and some arrows were retrieved and reused during the battle). Thus, the English archers shot about 300-500,000 arrows during the battle. The French losses aren't reliably known, but were perhaps about 2-4,000 armoured cavalry and perhaps about 15,000 infantry and crossbowmen. English archery was reportedly quite effective against the French cavalry (whose horses were unarmoured) and crossbowmen (who fought without their pavises, leaving them poorly protected). The French cavalrymen were well-protected by armour, even if their horses weren't - many of their dead had been wounded by arrows. Noting the the number of arrows shot by the English was about 20 times greater than the number of French dead, and many of the French were killed by English infantry rather than by arrows, the French were not that vulnerable to archery. The common fictional representation of English arrows punching through French armour as if it wasn't there simply doesn't represent the reality.
Which brings me to your question about infantry shield walls and the testudo. Shield walls provided reasonably good protection against archery, especially when the infantry also wore armour. Formations like the testudo provided even more protection - the testudo could be considered almost invulnerable to archery. The keys to archery effectiveness against shield walls was to protect the archers from the infantry closing with them, and plenty of arrows (to make up for little chance of effect with an individual arrow). In addition to field fortification and a screen of armoured infantry (as used against cavalry), the threat of cavalry attack could be used to keep the enemy infantry immobile.
An instructive battle is the Battle of Carrhae (53BC), when a numerically inferior Parthian cavalry force destroyed a larger Roman army. While the Parthian army was smaller, the Roman cavalry force was even smaller - the Parthians had little to fear from the Roman cavalry. The majority of the Parthian army was mounted archers (who could also fight in close combat), accompanied by heavy armoured cavalry. The Parthian archers used a combination of their mobility and the threat of cavalry attack if the Romans broke their formation to pursue them to keep the Roman infantry in place. The Parthian archery had some effect against the Romans (such as wounding them in their arms and legs - their shields, helmets, and body armour provided good protection), but the Roman could have endured the archery attack if the Parthians were limited to the typical number of arrows carried by mounted archers. However, the Parthians had brought along many (supposed many thousands) of pack camels loaded with arrows, and the Parthian archers were probably better supplied with arrows than the English would be at Crécy. The Romans attempted to use the testudo formation, but the Parthian heavy cavalry would then attack, forcing the Roman infantry back into a formation in which they could actually fight (but were more vulnerable to archery in). While this victory involved Parthian mounted archers rather than English longbowmen, the effectiveness of shield walls and testudo-like formations of armoured infantry against archery would be similar in both cases. The key difference is that the Parthian archers were more mobile, and didn't need field fortifications or a strong force of infantry to protect them.