Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 13 commits into from
May 17, 2023
17 changes: 17 additions & 0 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', []);
Expand All @@ -134,13 +135,13 @@ describe('LIVECHAT - Integrations', function () {
const response = await request.post(api('livechat/webhook.test')).set(credentials).expect(400);
expect(response.body).to.have.property('success', false);
});
it.skip('should return true if webhook test went good', async () => {
await updateSetting('Livechat_webhookUrl', 'https://httpbin.org/status/200');
it('should return true if webhook test went good', async () => {
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.skip('should fail if webhook test went bad', async () => {
await updateSetting('Livechat_webhookUrl', 'https://httpbin.org/status/400');
it('should fail if webhook test went bad', async () => {
await updateSetting('Livechat_webhookUrl', `${webhookUrl}/status/400`);
await request.post(api('livechat/webhook.test')).set(credentials).expect(400);
});
});
Expand Down
5 changes: 3 additions & 2 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -110,7 +111,7 @@ services:
- 'host.docker.internal:host-gateway'
depends_on:
- nats

queue-worker-service:
platform: linux/amd64
build:
Expand All @@ -126,7 +127,7 @@ services:
- 'host.docker.internal:host-gateway'
depends_on:
- nats

omnichannel-transcript-service:
platform: linux/amd64
build:
Expand Down