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

Testing timezones in BHIMA #7385

Open
jniles opened this issue Dec 26, 2023 · 0 comments
Open

Testing timezones in BHIMA #7385

jniles opened this issue Dec 26, 2023 · 0 comments

Comments

@jniles
Copy link
Contributor

jniles commented Dec 26, 2023

Per discussion with @jmcameron, based on discussions in #7382.

Note this doesn't really affect anyone but the tests, correctness of the tests, and the MD of Vanga who travels frequently.

Currently, the BHIMA test database does not control for varying timezones, causing test failures if the timezone of the host machine is not set to the timezone of the test dataset. There are a couple of potential sources of error:

  1. The test dataset was created at multiple different times, often with reference to the timezone (UTC+1 or UTC+2). These are often embedded in the new Date() or in the data.sql file. Because these are hard-coded, they will never change from these timezones, no matter what time the server is running in.
  2. The database does not have columns that capture timezones and MySQL dates are not timezone sensitive. So, they record everything in UTC (as the default for MySQL). In fact, there are quite a few caveats when it comes to understanding stored time in MySQL columns.
  3. The test server + client will run in the timezone of the user's machine. This means that filters such as "transactions created today" may be interpreted differently based on the timezone the user's machine is in. For example, if a transaction is made at 3AM in Vanga, is it still considered "Today" on the previous day in New Orleans. The test results will give two different results for two different people running the tests across the world.

In light of all this, we should come up with some kind of solution to ensure that the test results are reproducible everywhere. One idea is to only store test data in reference to UTC time, and then run all the tests with the server and client in the UTC timezone. Are there others?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant