This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Integration test coverage for path filtering #313
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cbdd86c
test: add 2 integration tests for URL path filters
hackebrot f8e1c53
f add path segment to GB Desktop Linux tile response
hackebrot 04e1724
f auto-format adm_settings.json
hackebrot e2a8dcd
f add path filters to DunBroch advertiser
hackebrot 1d76dfa
test: add new CI step for init_error integration tests
hackebrot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3" | ||
|
||
services: | ||
contile: | ||
environment: | ||
CONTILE_ADM_SETTINGS: /tmp/contile/adm_settings_init_error.json | ||
client: | ||
environment: | ||
SCENARIOS_FILE: /tmp/client/scenarios_init_error.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
scenarios: | ||
- name: advertiser_url_prefix_path_filter_missing_slash | ||
description: > | ||
Test that Contile terminates with an error if the adm_settings.json file | ||
contains a prefix path value without a trailing slash character. | ||
steps: | ||
- request: | ||
method: GET | ||
path: '/v1/tiles' | ||
headers: | ||
# Contile maps the User-Agent Header value to os-family and form-factor parameters | ||
# The following value will result in os-family: windows and form-factor: desktop | ||
- name: User-Agent | ||
value: 'Mozilla/5.0 (Windows NT 10.0; rv:10.0) Gecko/20100101 Firefox/91.0' | ||
# Contile looks up the IP address from this header value and maps it to proxy information. | ||
# We use a random IP address from the range specified by the CIDR network notation "81.2.69.192/28" | ||
# from https://github.com/maxmind/MaxMind-DB/blob/main/source-data/GeoLite2-City-Test.json | ||
# The following value will result in country-code: GB and region-code: ENG | ||
- name: X-Forwarded-For | ||
value: '81.2.69.204' | ||
response: | ||
# We expect this to fail, because Contile should terminate when loading the settings | ||
status_code: 200 | ||
content: | ||
tiles: | ||
- id: 41234 | ||
name: 'DunBroch' | ||
click_url: 'https://dunbroch.co.uk/gb_desktop_windows?version=16.0.0&key=22.1&ci=6.2&ctag=1612376952400200000' | ||
image_url: 'https://dunbroch.co.uk/gb_desktop_windows01.jpg' | ||
image_size: null | ||
impression_url: 'https://dunbroch.co.uk/gb_desktop_windows?id=0001' | ||
url: 'https://www.dunbroch.co.uk/gb_desktop_windows' | ||
position: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
integration-tests/volumes/contile/adm_settings_init_error.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"DunBroch": { | ||
"advertiser_urls": [ | ||
{ | ||
"host": "www.dunbroch.co.uk", | ||
"paths": [ | ||
{ | ||
"value": "/gb_desktop", | ||
"matching": "prefix" | ||
} | ||
] | ||
} | ||
], | ||
"click_hosts": [ | ||
"dunbroch.co.uk" | ||
], | ||
"impression_hosts": [ | ||
"dunbroch.co.uk" | ||
], | ||
"include_regions": [ | ||
"GB" | ||
], | ||
"position": 2 | ||
}, | ||
"DEFAULT": { | ||
"advertiser_urls": [], | ||
"click_hosts": [ | ||
"example.com" | ||
], | ||
"impression_hosts": [ | ||
"example.com" | ||
], | ||
"include_regions": [ | ||
"US", | ||
"GB" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed now, but you can use
timeout --kill-after=DURATION --signal=SIGNAL ...
to automatically kill a command with SIGNAL after DURATION seconds.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Here with
--abort-on-container-exit
docker compose will shut down all services as soon as thecontile
service exits or if that doesn't happen after theclient
exits because the test ran.