Skip to content

Commit ef566b2

Browse files
chore: fix contributor pr workflow with ipv6 tests (#32500)
* chore: fix contributor pr workflow with ipv6 tests * rename
1 parent 905fbdc commit ef566b2

File tree

3 files changed

+51
-20
lines changed

3 files changed

+51
-20
lines changed

.circleci/workflows.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,9 @@ jobs:
17751775
<<: *defaults
17761776
parameters:
17771777
<<: *defaultsParameters
1778+
is_contributor_pr:
1779+
type: boolean
1780+
default: false
17781781
resource_class:
17791782
type: string
17801783
default: medium
@@ -1797,31 +1800,46 @@ jobs:
17971800
condition:
17981801
equal: [ *windows-executor, << parameters.executor >> ]
17991802
steps:
1800-
- run:
1801-
name: Enable IPv6 in Docker
1802-
command: |
1803-
cat \<<'EOF' | sudo tee /etc/docker/daemon.json
1804-
{
1805-
"ipv6": true,
1806-
"fixed-cidr-v6": "2001:db8:1::/64"
1807-
}
1808-
EOF
1809-
cat \<<'EOF' | sudo tee /etc/hosts
1810-
127.0.0.1 localhost
1811-
::1 localhost
1812-
EOF
1813-
sudo service docker restart
1803+
- unless:
1804+
condition: << parameters.is_contributor_pr >>
1805+
steps:
1806+
- run:
1807+
name: Enable IPv6 in Docker
1808+
command: |
1809+
cat \<<'EOF' | sudo tee /etc/docker/daemon.json
1810+
{
1811+
"ipv6": true,
1812+
"fixed-cidr-v6": "2001:db8:1::/64"
1813+
}
1814+
EOF
1815+
cat \<<'EOF' | sudo tee /etc/hosts
1816+
127.0.0.1 localhost
1817+
::1 localhost
1818+
EOF
1819+
sudo service docker restart
18141820
- run:
18151821
name: Test scripts
18161822
command: |
18171823
source ./scripts/ensure-node.sh
18181824
yarn test-scripts
1819-
- run:
1820-
name: Test each individual package
1821-
command: |
1822-
source ./scripts/ensure-node.sh
1823-
# this is needed since we are have to be running as root to test some packages
1824-
sudo -E env "PATH=$PATH" yarn test
1825+
- when:
1826+
condition:
1827+
not: << parameters.is_contributor_pr >>
1828+
steps:
1829+
- run:
1830+
name: Test each individual package
1831+
command: |
1832+
source ./scripts/ensure-node.sh
1833+
# this is needed since we are have to be running as root to test some packages
1834+
sudo -E env "PATH=$PATH" yarn test
1835+
- when:
1836+
condition: << parameters.is_contributor_pr >>
1837+
steps:
1838+
- run:
1839+
name: Test each individual package
1840+
command: |
1841+
source ./scripts/ensure-node.sh
1842+
CIRCLE_IPV6_DISABLED=1 yarn test
18251843
- run:
18261844
name: Test types
18271845
command: |
@@ -3341,6 +3359,7 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
33413359
requires:
33423360
- contributor-pr
33433361
- unit-tests:
3362+
is_contributor_pr: true
33443363
requires:
33453364
- build
33463365
- verify-release-readiness:

packages/network/test/integration/connect_spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ describe('lib/connect', function () {
4343
// Error: listen EADDRNOTAVAIL ::1
4444
// NOTE: add an ipv6 lo if to the docker container
4545
it('resolves localhost on ::1 immediately', function () {
46+
// If we are on CI and IPV6 is explicitly disabled (like in the contributor PR workflow)
47+
// then we skip this test
48+
if (process.env.CIRCLE_IPV6_DISABLED) {
49+
this.skip()
50+
}
51+
4652
this.timeout(50)
4753

4854
const server = net.createServer(_.partialRight(_.invoke, 'close'))

packages/network/test/unit/agent_spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,12 @@ describe('lib/agent', function () {
10711071
})
10721072

10731073
it('caches host + port', async function () {
1074+
// If we are on CI and IPV6 is explicitly disabled (like in the contributor PR workflow)
1075+
// then we skip this test
1076+
if (process.env.CIRCLE_IPV6_DISABLED) {
1077+
this.skip()
1078+
}
1079+
10741080
const familyCache = {}
10751081

10761082
await Promise.all([

0 commit comments

Comments
 (0)