System.put_env("NERVES_PATH", File.cwd!())

File.cwd!()
|> Path.join("test_tmp")
|> File.rm_rf()

Application.start(:logger)
Logger.configure(handle_sasl_reports: true)
Logger.remove_backend(:console)

Code.compiler_options(ignore_module_conflict: true)
Mix.shell(Mix.Shell.Process)

System.put_env("NERVES_LOG_DISABLE_PROGRESS_BAR", "1")

ExUnit.start(exclude: [:skip])

System.put_env("NERVES_PATH", File.cwd!())

File.cwd!()
|> Path.join("test_tmp")
|> File.rm_rf()

Application.start(:logger)
Logger.configure(handle_sasl_reports: true)
Logger.remove_backend(:console)

Code.compiler_options(ignore_module_conflict: true)
Mix.shell(Mix.Shell.Process)

System.put_env("NERVES_LOG_DISABLE_PROGRESS_BAR", "1")

# Clear the project stack in preperation for loading and unloading fixtures
Mix.ProjectStack.clear_stack()

ExUnit.start(exclude: [:skip])

Fix issue with env_test failing randomly.
Fix issue with env_test failing randomly.

The mix project stack has :nerves as the top level project. Unload the stack so it can be ready to load a new mix file from a fixture. This prevents the first call to load_env from failing.

nerves-project/nerves,nerves-project/nerves