Skip to content

Commit

Permalink
test: url with port
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 12, 2024
1 parent b827245 commit b62073c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/unit/status/myDomainResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ describe('myDomainResolver', () => {
const TEST_IP = '1.1.1.1';
const CALL_COUNT = 3;

let lookupAsyncSpy: { callCount: number };
let lookupAsyncSpy: sinon.SinonStub;

beforeEach(() => {
lookupAsyncSpy = $$.SANDBOX.stub(dns, 'lookup').callsFake((host: string, callback: AnyFunction) => {
const isDefaultHost = host === MyDomainResolver.DEFAULT_DOMAIN.host;
Expand All @@ -45,6 +46,17 @@ describe('myDomainResolver', () => {
expect(lookupAsyncSpy.callCount).to.be.equal(CALL_COUNT);
});

it('should do lookup without port', async () => {
const options: MyDomainResolver.Options = {
url: new URL(`https://${POSITIVE_HOST}:6101`),
};
const resolver: MyDomainResolver = await MyDomainResolver.create(options);
const ip = await resolver.resolve();
expect(ip).to.be.equal(TEST_IP);
// verify that it uses hostname (without port) not host
expect(lookupAsyncSpy.args[0][0]).to.be.equal(POSITIVE_HOST);
});

describe('disable dns check', () => {
const env = new Env();
it('should return host if SFDX_DISABLE_DNS_CHECK is set to true', async () => {
Expand Down

3 comments on commit b62073c

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: b62073c Previous: 1afcc89 Ratio
Child logger creation 472153 ops/sec (±1.05%) 467852 ops/sec (±1.05%) 0.99
Logging a string on root logger 818053 ops/sec (±6.42%) 860220 ops/sec (±6.90%) 1.05
Logging an object on root logger 616196 ops/sec (±7.84%) 42097 ops/sec (±184.42%) 0.06831754831254991
Logging an object with a message on root logger 4215 ops/sec (±220.08%) 434653 ops/sec (±5.06%) 103.12
Logging an object with a redacted prop on root logger 452439 ops/sec (±7.56%) 508619 ops/sec (±5.40%) 1.12
Logging a nested 3-level object on root logger 379982 ops/sec (±7.57%) 19512 ops/sec (±186.49%) 0.051349800780036946

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: b62073c Previous: 1afcc89 Ratio
Logging an object with a message on root logger 4215 ops/sec (±220.08%) 434653 ops/sec (±5.06%) 103.12

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: b62073c Previous: 1afcc89 Ratio
Child logger creation 327284 ops/sec (±1.00%) 334160 ops/sec (±0.63%) 1.02
Logging a string on root logger 822428 ops/sec (±7.09%) 783790 ops/sec (±8.48%) 0.95
Logging an object on root logger 645143 ops/sec (±7.84%) 609843 ops/sec (±8.00%) 0.95
Logging an object with a message on root logger 20136 ops/sec (±185.44%) 4151 ops/sec (±213.90%) 0.21
Logging an object with a redacted prop on root logger 459493 ops/sec (±7.69%) 427278 ops/sec (±14.69%) 0.93
Logging a nested 3-level object on root logger 329164 ops/sec (±6.88%) 343296 ops/sec (±4.74%) 1.04

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.