fixes in dockerfiles and the test variables

This commit is contained in:
Christopher DeCairos 2019-09-27 12:54:03 -04:00
Родитель 190df0dba4
Коммит f352aab814
5 изменённых файлов: 7 добавлений и 9 удалений

Просмотреть файл

@ -16,8 +16,6 @@ COPY ./requirements.txt .
RUN . /app/venv/bin/activate && pip install -r requirements.txt
COPY ./stress_test.py .
COPY ./scripts/start_follower.sh ./scripts/
RUN useradd -ms /bin/bash locust

Просмотреть файл

@ -1,6 +1,5 @@
FROM cade/donate-locust:base-latest
COPY ./scripts/start_follower.sh .
CMD . /app/venv/bin/activate && ./start_follower.sh

Просмотреть файл

@ -21,7 +21,7 @@ spec:
spec:
containers:
- name: locust-follower
image: cade/donate-locust@sha256:bd33eaea3faafa58b682b38b4277287a12ec0b2d7bce1c34afdc4aade5164136
image: cade/donate-locust@sha256:37a520370507907d74678a40ec594de6cad7afca35359478d498dfb1ae3c7fa5
imagePullPolicy: IfNotPresent
env:
- name: TARGET_URL

Просмотреть файл

@ -21,7 +21,7 @@ spec:
spec:
containers:
- name: locust-leader
image: cade/donate-locust@sha256:24ea47dbea89ad963cb547845e6c33e9a590f11377cdcab8e431ce3d5d0bd4f2
image: cade/donate-locust@sha256:d5c2e29a12b93e1acd818f7fa049c4930824750d14813945aa3abd23d3c426eb
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8089

Просмотреть файл

@ -19,21 +19,22 @@ class DonorBehaviour(TaskSequence):
'town': 'Toronto',
'country': 'CA',
'amount': 50,
'landing_url': 'https://donate-wagtail-staging.herokuapp.com/en-US/',
'landing_url': '',
'project': 'mozillafoundation',
'campaign_id': 'test-campaign',
'campaign_id': '',
# https://developers.braintreepayments.com/reference/general/testing/python#nonces-representing-cards
'braintree_nonce': 'fake-valid-nonce'
}
self.donation_params = {
'currency': 'usd',
# This source_page_id is the main donate landing page on staging
'source_page_id': 3,
'amount': 50
}
@seq_task(1)
def load_donate_form(self):
resp = self.client.get('/en-CA/')
resp = self.client.get('/en-US/')
@seq_task(2)
def load_payment_information_form(self):
@ -49,4 +50,4 @@ class DonorBehaviour(TaskSequence):
class DonorUser(HttpLocust):
task_set = DonorBehaviour
# exponentially distributed wait time between actions, avg 15 seconds
wait_function = lambda self: random.expovariate(1) * 2000
wait_function = lambda self: random.expovariate(1) * 10000