Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run wing.compile to create a testing simulator and to a non testing simulator in the same process #5254

Closed
ainvoner opened this issue Dec 19, 2023 · 2 comments
Labels
🐛 bug Something isn't working 🕹️ simulator Related to the `sim` compilation target

Comments

@ainvoner
Copy link
Contributor

I tried this:

in the same process of my node application, I'm trying to compile to a stateful simulator (non testing mode) and to a simulator runs in a testing mode.

const nonTestSim = await wing.compile(wingfile, {
        platform,
        testing: false,
      });
const testSim = await wing.compile(wingfile, {
        platform,
        testing: true,
      });
bring util;

if util.tryEnv("WING_IS_TEST") == "true" {
  log("Running in test mode");
} else {
  log("Not Running in test mode");
}

This happened:

both simulators run in testing mode

I expected this:

the first one to work in regular mode and the last one in testing mode.

Is there a workaround?

No response

Anything else?

process.env["WING_IS_TEST"] = testing.toString();

if you run two compilers in the same process, the last one will override the process.envs with the latest values…
in the console we do exactly that:
const compiler = createCompiler({

and
const testCompiler = createCompiler({

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@ainvoner ainvoner added 🐛 bug Something isn't working 🕹️ simulator Related to the `sim` compilation target labels Dec 19, 2023
@ainvoner ainvoner added this to Wing Dec 19, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Dec 19, 2023
@MarkMcCulloh
Copy link
Contributor

This is a dupe of #3678 which will be addressed in #5247

@MarkMcCulloh MarkMcCulloh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New - not properly defined to ✅ Done in Wing Dec 19, 2023
@staycoolcall911
Copy link
Contributor

Thanks @MarkMcCulloh - since it's a blocker for @ainvoner, let's see if we can ship that fix earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🕹️ simulator Related to the `sim` compilation target
Projects
Archived in project
Development

No branches or pull requests

3 participants