Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84472df

Browse files
committed
[CI] prerelease tests - all passing
``` ❯ ./vendor/bin/phpunit PHPUnit 11.5.55 by Sebastian Bergmann and contributors. Runtime: PHP 8.4.20 Configuration: /Users/barryo/dev/ixpm-inex/phpunit.xml ............................................................... 63 / 525 ( 12%) ............................................................... 126 / 525 ( 24%) ............................................................... 189 / 525 ( 36%) ............................................................... 252 / 525 ( 48%) ............................................................... 315 / 525 ( 60%) ............................................................... 378 / 525 ( 72%) ............................................................... 441 / 525 ( 84%) ............................................................... 504 / 525 ( 96%) ..................... 525 / 525 (100%) Time: 03:24.126, Memory: 135.00 MB OK (525 tests, 4113 assertions) ```
1 parent 85ed058 commit 84472df

4 files changed

Lines changed: 22 additions & 18 deletions

File tree

.env.ci

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ IXP_FE_FRONTEND_CUSTOMER_OWNERS="customers'"
5858

5959
# See: https://docs.ixpmanager.org/latest/features/irrdb/
6060
# IXP_IRRDB_BGPQ3_PATH=/usr/local/bin/bgpq3
61-
IXP_IRRDB_BGPQ3_PATH=/usr/bin/bgpq3
62-
IXP_IRRDB_BGPQ4_PATH=/usr/bin/bgpq4
61+
IXP_IRRDB_BGPQ3_PATH=bgpq3
62+
IXP_IRRDB_BGPQ4_PATH=bgpq4
6363

6464
# 2fa is disabled in the test environment as the tests emulating web requests
6565
# do not have an understanding of 2fa. we enable 2fa manually when we need to

tests/Api/CustomerControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testQueryDbWithAsn()
3636
->andReturn( $mockResponseData );
3737
});
3838

39-
$response = $this->withKey()->get( "api/v4/customer/query-peeringdb/asn/1213" );
39+
$response = $this->withKey()->get( "admin/api/v4/customer/query-peeringdb/asn/1213" );
4040
$response->assertStatus( 200 );
4141
$response->assertExactJson( [
4242
"net" => $mockResponseData
@@ -53,7 +53,7 @@ public function testQueryDbWithAsn_Failure()
5353
$mock->status = 404;
5454
});
5555

56-
$response = $this->withKey()->get( "api/v4/customer/query-peeringdb/asn/0" );
56+
$response = $this->withKey()->get( "admin/api/v4/customer/query-peeringdb/asn/0" );
5757
$response->assertStatus( 200 );
5858
$response->assertExactJson( [
5959
"error" => "No network with AS0 found in PeeringDB"

tests/Api/RouterTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ public function tearDown(): void {
115115

116116
public function testApiRouterNotExists(): void
117117
{
118-
$response = $this->withKey()->get( '/api/v4/router/updated/test-router-xxx' );
118+
$response = $this->withKey()->get( '/admin/api/v4/router/updated/test-router-xxx' );
119119
$response->assertStatus( 404 );
120120
}
121121

122122

123123
public function testApiRouterGetLastUpdatedNulls(): void
124124
{
125-
$response = $this->withKey()->get( '/api/v4/router/updated/test-router' );
125+
$response = $this->withKey()->get( '/admin/api/v4/router/updated/test-router' );
126126
$response->assertStatus( 200 );
127127

128128
$this->assertNull( $response->json('last_update_started') );
@@ -137,7 +137,7 @@ public function testApiRouterGetLastUpdatedNotNulls(): void
137137
$this->r->last_update_started = $this->r->last_updated = $now;
138138
$this->r->save();
139139

140-
$response = $this->withKey()->get( '/api/v4/router/updated/test-router' );
140+
$response = $this->withKey()->get( '/admin/api/v4/router/updated/test-router' );
141141
$response->assertStatus( 200 );
142142

143143
$this->assertNotNull( $response->json('last_update_started') );
@@ -157,15 +157,15 @@ public function testNoUpdateLockIfPaused(): void
157157
$this->r->pause_updates = true;
158158
$this->r->save();
159159

160-
$response = $this->withKey()->post( '/api/v4/router/get-update-lock/test-router' );
160+
$response = $this->withKey()->post( '/admin/api/v4/router/get-update-lock/test-router' );
161161
$response->assertStatus( 423 );
162162
$response->assertContent( 'Router not available for update' );
163163
}
164164

165165

166166
public function testApiRouterGetUpdateLockOnNulls(): void
167167
{
168-
$response = $this->withKey()->post( '/api/v4/router/get-update-lock/test-router' );
168+
$response = $this->withKey()->post( '/admin/api/v4/router/get-update-lock/test-router' );
169169
$response->assertStatus( 200 );
170170

171171
$this->assertNotNull( $response->json('last_update_started') );
@@ -180,7 +180,7 @@ public function testApiRouterGetUpdateLockOnNulls(): void
180180
$this->assertNotNull( $this->r->last_update_started );
181181
$this->assertNull( $this->r->last_updated );
182182

183-
$response = $this->withKey()->post( '/api/v4/router/updated/test-router' );
183+
$response = $this->withKey()->post( '/admin/api/v4/router/updated/test-router' );
184184
$response->assertStatus( 200 );
185185

186186
$this->assertNotNull( $response->json('last_updated') );
@@ -199,7 +199,7 @@ public function testApiRouterGetUpdateLockOnNotNulls(): void
199199
$this->r->last_update_started = $this->r->last_updated = now()->addSecond();
200200
$this->r->save();
201201

202-
$response = $this->withKey()->post( '/api/v4/router/get-update-lock/test-router' );
202+
$response = $this->withKey()->post( '/admin/api/v4/router/get-update-lock/test-router' );
203203
$response->assertStatus( 200 );
204204

205205
$this->assertNotNull( $response->json('last_update_started') );
@@ -218,7 +218,7 @@ public function testApiRouterGetUpdateLockOnNotNulls(): void
218218

219219
public function testApiRouterReleaseLockOnNotLocked(): void
220220
{
221-
$response = $this->withKey()->post( '/api/v4/router/release-update-lock/test-router' );
221+
$response = $this->withKey()->post( '/admin/api/v4/router/release-update-lock/test-router' );
222222
$response->assertStatus( 200 );
223223

224224
$this->assertNull( $response->json('last_update_started') );
@@ -232,7 +232,7 @@ public function testApiRouterReleaseLockOnFirstUpdateStarted(): void
232232
$this->r->last_update_started = now()->subMinutes( 2 );
233233
$this->r->save();
234234

235-
$response = $this->withKey()->post( '/api/v4/router/release-update-lock/test-router' );
235+
$response = $this->withKey()->post( '/admin/api/v4/router/release-update-lock/test-router' );
236236
$response->assertStatus( 200 );
237237

238238
$this->assertNull( $response->json( 'last_update_started' ) );
@@ -248,7 +248,7 @@ public function testApiRouterReleaseLockOnSubsequentUpdateStarted(): void
248248
$this->r->last_update_started = now();
249249
$this->r->save();
250250

251-
$response = $this->withKey()->post( '/api/v4/router/release-update-lock/test-router' );
251+
$response = $this->withKey()->post( '/admin/api/v4/router/release-update-lock/test-router' );
252252
$response->assertStatus( 200 );
253253

254254
$this->assertNotNull( $response->json('last_update_started') );
@@ -270,7 +270,7 @@ public function testApiRouterSetUpdatedFirstTime(): void
270270
$this->r->last_update_started = $now->clone()->subMinutes( 2 );
271271
$this->r->save();
272272

273-
$response = $this->withKey()->post( '/api/v4/router/updated/test-router' );
273+
$response = $this->withKey()->post( '/admin/api/v4/router/updated/test-router' );
274274
$response->assertStatus( 200 );
275275

276276
$this->assertNotNull( $response->json( 'last_update_started' ) );
@@ -291,7 +291,7 @@ public function testApiRouterSetUpdatedSubsequent(): void
291291
$this->r->last_updated = $now->clone()->subMinute();
292292
$this->r->save();
293293

294-
$response = $this->withKey()->post( '/api/v4/router/updated/test-router' );
294+
$response = $this->withKey()->post( '/admin/api/v4/router/updated/test-router' );
295295
$response->assertStatus( 200 );
296296

297297
$this->assertNotNull( $response->json( 'last_update_started' ) );
@@ -309,7 +309,7 @@ public function testApiRouterPairUpdatingBlocksOnNulls(): void {
309309
$this->rpair->last_update_started = now()->subMinutes( 2 );
310310
$this->rpair->save();
311311

312-
$response = $this->withKey()->post( '/api/v4/router/get-update-lock/test-router' );
312+
$response = $this->withKey()->post( '/admin/api/v4/router/get-update-lock/test-router' );
313313

314314
$response->assertStatus( 423 );
315315
$this->assertEquals( 'Router not available for update', $response->getContent() );
@@ -321,7 +321,7 @@ public function testApiRouterPairUpdatingBlocksOnSubsequent(): void {
321321
$this->rpair->last_update_started = now()->subMinutes( 2 );
322322
$this->rpair->save();
323323

324-
$response = $this->withKey()->post( '/api/v4/router/get-update-lock/test-router' );
324+
$response = $this->withKey()->post( '/admin/api/v4/router/get-update-lock/test-router' );
325325

326326
$response->assertStatus( 423 );
327327
$this->assertEquals( 'Router not available for update', $response->getContent() );

tests/Console/Utils/UpdateAsnDatabaseTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ protected function tearDown(): void
4949

5050
public function testFreshFromFile()
5151
{
52+
// let's ensure we're starting with a clean slate
53+
Asn::truncate();
54+
55+
5256
$this->assertEquals(0, Asn::count());
5357
$this->artisan('utils:asn-update -v ' . $this->getSampleFilePath())
5458
->assertExitCode(0)

0 commit comments

Comments
 (0)