The scripture warns against testing the Lord in the context of risking yourself or others and counting upon the Lord to prevent their choices from bringing harm. You don't choose to spend you last dime and expect that the Lord will provide magical remuneration.
And, yes. The Bible is full of allegory. The crreation story is entirely allegory. Think about it; is God speaking, "Let there be light" any less a decent allegory than filming a bathtup filled with salt grains draining, reversing that footage, and calling it an example of how the Big Bang might have looked?
Some things have historical basis in fact. Much of includes allegory for teaching. For example, the destruction of cities around the Dead Sea were part of the oral traditions of the region, even to the formations of the rock and hillsides and mountains of the are; those stories became part of lessons to the people and probably incorporated real historical figures in the allegory. But, archeological findings support the history of the destructions of those cities, even though it cannot prove the reasons. An ancient people told the stories of their history, and tried to understand it in the way of their period in time and their cultures. We do the same thing today; it's human nature. We cannot write off the historical basis of those stories because the allegory is part of the record that has come down to us. It is our responsibility, however, to dicern the hsitorical from the allegory. That's just common sense.
There is something in what you say about using fear to control. That's one of the keys to discernment right there. Anything using fear to control people is not love.
And, yes… I know the scripture in English translations says, "fear the Lord." But, the original language texts use words that more accurately mean to be in awe of, or to be amazed by God. Again, people want clear, simple terms; so, the simple translation to English was "fear," stripping away the depth and warmth of the original texts.