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

Fix tunnel builds #306

Merged
merged 2 commits into from Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/lib/getEnv.js
Expand Up @@ -2,7 +2,7 @@
const {
CHROMATIC_SERVER_PORT = 3004,
CHROMATIC_INDEX_URL = 'https://index.chromatic.com',
CHROMATIC_TUNNEL_URL = 'https://tunnel.chromatic.com',
CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com',
CHROMATIC_CREATE_TUNNEL = 'true',
CHROMATIC_RETRIES = 5,
CHROMATIC_POLL_INTERVAL = 1000,
Expand Down
8 changes: 4 additions & 4 deletions bin/tasks/tunnel.test.js
Expand Up @@ -10,19 +10,19 @@ const log = { debug: jest.fn() };

describe('createTunnel', () => {
it('opens the tunnel and sets the isolatorUrl on context', async () => {
openTunnel.mockReturnValue({ url: 'https://tunnel.chromatic.com' });
openTunnel.mockReturnValue({ url: 'https://tunnel.chromaticqa.com' });

const ctx = { log, isolatorUrl: 'http://localhost:9001', options: {} };
await createTunnel(ctx);

expect(openTunnel).toHaveBeenCalledWith({ log, port: '9001', https: undefined });
expect(ctx.isolatorUrl).toBe('https://tunnel.chromatic.com/');
expect(ctx.isolatorUrl).toBe('https://tunnel.chromaticqa.com/');
});
});

describe('testConnection', () => {
it('tries to fetch the isolatorUrl', async () => {
testConnection({ isolatorUrl: 'https://tunnel.chromatic.com' });
expect(fetch).toHaveBeenCalledWith('https://tunnel.chromatic.com');
testConnection({ isolatorUrl: 'https://tunnel.chromaticqa.com' });
expect(fetch).toHaveBeenCalledWith('https://tunnel.chromaticqa.com');
});
});
2 changes: 1 addition & 1 deletion bin/tasks/verify.test.js
Expand Up @@ -28,7 +28,7 @@ describe('createBuild', () => {
git: { version: 'whatever', matchesBranch: () => false },
pkg: { version: '1.0.0' },
storybook: { version: '2.0.0', viewLayer: 'react', addons: [] },
isolatorUrl: 'https://tunnel.chromatic.com/',
isolatorUrl: 'https://tunnel.chromaticqa.com/',
};

it('creates a build on the index and puts it on context', async () => {
Expand Down
2 changes: 1 addition & 1 deletion bin/ui/messages/errors/fatalError.stories.js
Expand Up @@ -36,7 +36,7 @@ const context = {
number: 1400,
webUrl: 'https://www.chromatic.com/build?appId=5d67dc0374b2e300209c41e7&number=1400',
},
isolatorUrl: 'https://pfkaemtlit.tunnel.chromatic.com/iframe.html',
isolatorUrl: 'https://pfkaemtlit.tunnel.chromaticqa.com/iframe.html',
cachedUrl: 'https://5d67dc0374b2e300209c41e7-pfkaemtlit.chromatic.com/iframe.html',
};

Expand Down
4 changes: 2 additions & 2 deletions bin/ui/tasks/tunnel.stories.js
Expand Up @@ -6,8 +6,8 @@ export default {
decorators: [(storyFn) => task(storyFn())],
};

const CHROMATIC_TUNNEL_URL = 'https://tunnel.chromatic.com';
const cachedUrl = 'https://fdeulpymiq.tunnel.chromatic.com/iframe.html';
const CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com';
const cachedUrl = 'https://fdeulpymiq.tunnel.chromaticqa.com/iframe.html';

export const Initial = () => initial;

Expand Down
2 changes: 1 addition & 1 deletion stories/timing.stories-disabled.js
Expand Up @@ -6,7 +6,7 @@ import React, { useState } from 'react';

// Some stories to test out timing code. Disabled by default
// These stories are available at (e.g.)
// http://vmdbnybkvx.tunnel.staging-chromatic.com/iframe.html?id=timing--5s
// http://vmdbnybkvx.staging-tunnel.chromaticqa.com/iframe.html?id=timing--5s

// A component that guarantees the load event won't load for timeout seconds
// Note that the img loading tends to take a litle longer so this is a minimum
Expand Down