Add a regression test for stack env variable

[#82289072]