Skip to content
Snippets Groups Projects
Unverified Commit 1e1f4674 authored by Murtaza Patrawala's avatar Murtaza Patrawala Committed by Diego Sampaio
Browse files

test: use local httpbin container on github CI's (#29067)

parent 924c3ef8
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,23 @@ jobs:
- uses: dtinth/setup-github-actions-caching-for-turbo@v1
- name: Start httpbin container and wait for it to be ready
run: |
docker run -d -p 10000:80 --name httpbin-container kennethreitz/httpbin
i=0
while [ $i -lt 10 ]; do
if curl -s -o /dev/null http://localhost:10000; then
echo "httpbin is running"
break
fi
i=$((i + 1))
sleep 5
done
if [ $i -eq 10 ]; then
echo "Failed to verify httpbin is running"
exit 1
fi
- name: yarn build
run: yarn build
......
......@@ -122,6 +122,7 @@ describe('LIVECHAT - Integrations', function () {
});
describe('Livechat - Webhooks', () => {
const webhookUrl = process.env.WEBHOOK_TEST_URL || 'https://httpbin.org';
describe('livechat/webhook.test', () => {
it('should fail when user doesnt have view-livechat-webhooks permission', async () => {
await updatePermission('view-livechat-webhooks', []);
......@@ -136,14 +137,12 @@ describe('LIVECHAT - Integrations', function () {
expect(response.body).to.have.property('success', false);
});
it('should return true if webhook test went good', async () => {
await updateSetting('Livechat_webhookUrl', 'https://httpbin.org/status/200');
await setTimeout(() => null, 1000);
await updateSetting('Livechat_webhookUrl', `${webhookUrl}/status/200`);
const response = await request.post(api('livechat/webhook.test')).set(credentials).expect(200);
expect(response.body.success).to.be.true;
});
it('should fail if webhook test went bad', async () => {
await updateSetting('Livechat_webhookUrl', 'https://httpbin.org/status/400');
await setTimeout(() => null, 1000);
await updateSetting('Livechat_webhookUrl', `${webhookUrl}/status/400`);
await request.post(api('livechat/webhook.test')).set(credentials).expect(400);
});
});
......
......@@ -15,6 +15,7 @@ services:
- 'TRANSPORTER=${TRANSPORTER}'
- MOLECULER_LOG_LEVEL=info
- 'ROCKETCHAT_LICENSE=${ENTERPRISE_LICENSE}'
- 'WEBHOOK_TEST_URL=host.docker.internal:10000'
extra_hosts:
- 'host.docker.internal:host-gateway'
depends_on:
......@@ -110,7 +111,7 @@ services:
- 'host.docker.internal:host-gateway'
depends_on:
- nats
queue-worker-service:
platform: linux/amd64
build:
......@@ -126,7 +127,7 @@ services:
- 'host.docker.internal:host-gateway'
depends_on:
- nats
omnichannel-transcript-service:
platform: linux/amd64
build:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment