Skip to content

Commit d74fa76

Browse files
committed
Defend against setting PR ID and localhost at the same time
1 parent 8fbce99 commit d74fa76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ For example:
7979
product=cpts-ui env=internal-dev PULL_REQUEST_ID=pr-300 tags=cpt-ui HEADLESS=true make run-tests
8080
```
8181

82-
Note that CPT-UI supports localhost testing. To do this, use the `env=localhost` variable. Make sure your localhost server is running!
82+
Note that CPT-UI supports localhost testing. To do this, use the `env=localhost` variable - but ensure you have *not* set the `PULL_REQUEST_ID` variable, as it is not needed and will break the tests. Make sure your localhost server is running!
8383

8484
### Method 4 (Not Recommended):
8585
Run the tests by running `behave` in a command prompt or terminal window.

features/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def before_all(context):
135135
context.pfp_base_url = os.path.join(select_apigee_base_url(env), PFP_SUFFIX)
136136
context.psu_base_url = os.path.join(select_apigee_base_url(env), PSU_SUFFIX)
137137

138-
if PULL_REQUEST_ID:
138+
if PULL_REQUEST_ID and env != "LOCALHOST":
139139
print(f"--- Using pull request id: '{PULL_REQUEST_ID}'")
140140
pull_request_id = PULL_REQUEST_ID.lower()
141141
if "pr-" in pull_request_id:

0 commit comments

Comments
 (0)