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

Some tests fail using --split option while using ember-i18n #100

Open
jzisser9 opened this issue Jul 18, 2017 · 2 comments
Open

Some tests fail using --split option while using ember-i18n #100

jzisser9 opened this issue Jul 18, 2017 · 2 comments

Comments

@jzisser9
Copy link

jzisser9 commented Jul 18, 2017

Hi there,
We've been using ember-exam in our project for a while, and it's worked great. However, recently we also began using ember-i18n and have noticed that some of our tests began to fail with the following message: Error: Assertion Failed: I18n: Cannot translate when locale is null.

We usually split our tests into 5 partitions and I can reliably reproduce these failures on partitions 1 and 3. Running the tests without the --split command causes all of the tests to pass.

We configure the default locale for i18n in our config/environment.js file. We also use testem, and our testem.json file is as follows:

{
  "framework": "qunit",
  "test_page": "tests/index.html?hidepassed",
  "phantomjs_debug_port": 5001,
  "disable_watching": true,
  "launch_in_ci": [
    "PhantomJS"
  ],
  "launch_in_dev": [
    "PhantomJS",
    "Chrome"
  ],
  "proxies": {
    "/api": {
      "port": 3000,
      "host": "localhost"
    },
    "/users": {
      "port": 3000,
      "host": "localhost"
    }
  }
}

I wanted to report this here in case it's buggy behavior, but I was also hoping to see if we can diagnose and fix the issue without needing a bugfix. How does --split work? What does the process under the hood look like compared to running tests without the --split option? It seems like maybe what's going on is that our configuration options aren't "taking" to each partition, but that's just a shot in the dark since I don't know exactly how --split works.

We are running the following software versions:

ember-cli: 2.7.0
node: 7.9.0
os: darwin x64

@ekcrisp
Copy link

ekcrisp commented Jun 11, 2018

i think we have the same issue

@ekcrisp
Copy link

ekcrisp commented Jun 11, 2018

I noticed when using ember-exam application initializers are not run before every test, this is the cause of the issue in our case, we use an initializer to load i18n content, sometimes this content changes based on the test and with exam we have to explicitly run the initializer in order for this to work, without exam it runs automatically

@Turbo87 Turbo87 removed the support label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants