Skip to content

Multi-org: format base path, not including protocol - #7260

Merged
eradman merged 1 commit into
getredash:masterfrom
eradman:alert-tests
Dec 18, 2025
Merged

eradman merged 1 commit into
getredash:masterfrom
eradman:alert-tests

Conversation

@eradman

@eradman eradman commented Dec 24, 2024

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • Tests

Description

Other tests and local settings sometimes caused this test to fail.

How is this tested?

  • Unit tests (pytest, jest)

@codecov

codecov Bot commented Jan 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.03%. Comparing base (d03a2c4) to head (3711d87).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7260      +/-   ##
==========================================
+ Coverage   64.01%   64.03%   +0.01%     
==========================================
  Files         163      163              
  Lines       13410    13410              
  Branches     1905     1905              
==========================================
+ Hits         8585     8587       +2     
+ Misses       4490     4489       -1     
+ Partials      335      334       -1     

see 1 file with indirect coverage changes

@eradman
eradman force-pushed the alert-tests branch 2 times, most recently from 038ca94 to 334b9ad Compare May 9, 2025 17:39
@eradman

eradman commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

@yoshiokatsuneo if you have time, can you review this change? TestAlertRenderTemplate often fails in my dev environment because of settings in .env

@yoshiokatsuneo

Copy link
Copy Markdown
Contributor

@eradman

Thank you for improving test environment.

I wonder whether it is good idea to change/reset settings on every tests, as it may make test code a bit messy...
How about using separate .env file for testing ( like .env_test ) ?

@yoshiokatsuneo

Copy link
Copy Markdown
Contributor

Or, possibly, we can statically setup settings on the base TestCase class ?

@eradman

eradman commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

How about using separate .env file for testing ( like .env_test ) ?

This is not a bad idea: there are probably other test cases that would fail with modified settings.

Remove hard-coded 'https://' when MULTI_ORG is enabled
@eradman eradman changed the title Use fixed environment for TestAlertRenderTemplate Multi-org: format base path, not including protocol Dec 17, 2025
@eradman

eradman commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator Author

Instead of sanitizing the environment, I modified the utils.base_url() to prevent it from returning a hard-coded protocol (https://) when MULTI_ORG is enabled. As near as I can tell this is a bug, and not noticed by anyone.

@yoshiokatsuneo yoshiokatsuneo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eradman

Thank you ! Actually, it looks a bug, and you fixed it !

@eradman
eradman merged commit 262d46f into getredash:master Dec 18, 2025
@eradman
eradman deleted the alert-tests branch December 18, 2025 00:34
@eradman

eradman commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks for the review again @yoshiokatsuneo!
MULTI_ORG has been an experimental feature, so most users are not likely to hit this code path.

woogakoki added a commit to wooga/redash that referenced this pull request Feb 25, 2026
* master: (69 commits)
  Update Python version to 3.13 (getredash#7636)
  Update plotly.js to 3.3.1, react-pivottable to 0.11.0 (getredash#7634)
  Add charset option to RDS MySQL datasource (getredash#7616)
  Aggregate y value for same x (getredash#7631)
  fix(mysql): Change default charset to utf8mb4 (getredash#7615)
  Update packages for compatibility with setuptools 82 (getredash#7622)
  Snapshot: 26.02.0-dev
  chore: support ipv6 for server in docker (getredash#7596)
  Add impersonation option in trino datasource (getredash#7605)
  Fix Elasticsearch connector configuration key mismatch (getredash#7607)
  duckdb: Show catalog (database) where applicable (e.g. Motherduck) (getredash#7599)
  Snapshot: 26.01.0-dev
  Feature/catch notsupported exception (getredash#7573)
  Multi-org: format base path, not including protocol (getredash#7260)
  fix(destinations): Handle unicode characters in webhook notifications (getredash#7586)
  Persist updated values and apply saved dashboard parameters (getredash#7570)
  Add ibm-db package to enable DB2 as datasource: (getredash#7581)
  Snapshot: 25.12.0-dev
  PostgreSQL: allow connection parameters to be specified (getredash#7579)
  Add lineShape option for Line and Area charts (getredash#7582)
  ...
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

Successfully merging this pull request may close these issues.

2 participants