Skip to content

Commit 7b194bc

Browse files
committed
B2B-2530: Unskip GraphQL cache tests skipped due to DEVOPS-4924
- Adjusted reivew comments
1 parent 41eeb47 commit 7b194bc

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/CacheTagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testCacheInvalidationForProducts()
4242
// Cache should be a MISS when product is queried for first time
4343
$response = $this->graphQlQueryWithResponseHeaders($query);
4444
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $response['headers']);
45-
// Obtain the X-Magento-Cache-Id from the response which will be used as the cache key
45+
// Obtain the X-Magento-Cache-Id from the response
4646
$cacheId = $response['headers'][CacheIdCalculator::CACHE_ID_HEADER];
4747
// Verify we obtain a cache MISS the first time
4848
$this->assertCacheMissAndReturnResponse($query, [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
@@ -108,7 +108,7 @@ public function testCacheInvalidationForCategoriesWithProduct()
108108
[CacheIdCalculator::CACHE_ID_HEADER => $cacheIdOfSecondProduct]
109109
);
110110

111-
// cache-debug header value should be MISS after updating product1 and reloading the Category
111+
// updating product1
112112
$firstProduct->setPrice(20);
113113
$productRepository->save($firstProduct);
114114

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/BlockCacheTest.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public function testCacheIsUsedOnSecondRequest()
3333
$response = $this->graphQlQueryWithResponseHeaders($query);
3434
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $response['headers']);
3535
$cacheId = $response['headers'][CacheIdCalculator::CACHE_ID_HEADER];
36-
// Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
36+
// Verify we obtain a cache MISS the first time
3737
$this->assertCacheMissAndReturnResponse($query, [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
38-
// Verify we obtain a cache HIT the second time we search the cache using this X-Magento-Cache-Id
38+
// Verify we obtain a cache HIT the second time
3939
$responseHit = $this->assertCacheHitAndReturnResponse(
4040
$query,
4141
[CacheIdCalculator::CACHE_ID_HEADER => $cacheId]
@@ -94,27 +94,26 @@ public function testCacheIsInvalidatedOnBlockUpdate()
9494
[CacheIdCalculator::CACHE_ID_HEADER => $cacheIdOfEnabledBlock]
9595
);
9696

97+
//cache-debug should be a MISS after updating content on fixture block
9798
$newBlockContent = 'New block content!!!';
9899
$this->updateBlockContent($fixtureBlockIdentifier, $newBlockContent);
99100

100-
//cache-debug should be a MISS after update the block on fixture block query
101-
// Verify we obtain a cache MISS the first time after update on the fixture block
102-
$fixtureBlockHitResponse = $this->assertCacheMissAndReturnResponse(
101+
// Verify we obtain a cache MISS update on the fixture block
102+
$fixtureBlockMissResponse = $this->assertCacheMissAndReturnResponse(
103103
$fixtureBlockQuery,
104104
[CacheIdCalculator::CACHE_ID_HEADER => $cacheIdOfFixtureBlock]
105105
);
106106

107-
//cache-debug should be a HIT after update the block on enabled block query
108-
// Verify we obtain a cache HIT on the updated enabled block
109-
$this->assertCacheHitAndReturnResponse(
107+
//Verify we obtain a cache HIT on the enabled block query after the fixture block is updated
108+
$enabledBlockHitResponse = $this->assertCacheHitAndReturnResponse(
110109
$enabledBlockQuery,
111110
[CacheIdCalculator::CACHE_ID_HEADER => $cacheIdOfEnabledBlock]
112111
);
113112

113+
$this->assertNotEmpty($enabledBlockHitResponse['body']);
114114
//updated block data should be correct on fixture block
115-
$this->assertNotEmpty($fixtureBlockHitResponse['body']);
116-
$blocks = $fixtureBlockHitResponse['body']['cmsBlocks']['items'];
117-
$this->assertArrayNotHasKey('errors', $fixtureBlockHitResponse['body']);
115+
$blocks = $fixtureBlockMissResponse['body']['cmsBlocks']['items'];
116+
$this->assertArrayNotHasKey('errors', $fixtureBlockMissResponse['body']);
118117
$this->assertEquals($fixtureBlockIdentifier, $blocks[0]['identifier']);
119118
$this->assertEquals('CMS Block Title', $blocks[0]['title']);
120119
$this->assertEquals($newBlockContent, $blocks[0]['content']);

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/PageCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testCacheIsUsedOnSecondRequest()
4747

4848
$response = $this->graphQlQueryWithResponseHeaders($query);
4949
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $response['headers']);
50-
// Obtain the X-Magento-Cache-Id from the response which will be used as the cache key
50+
// Obtain the X-Magento-Cache-Id from the response
5151
$cacheId = $response['headers'][CacheIdCalculator::CACHE_ID_HEADER];
5252
// Verify we obtain a cache MISS the first time
5353
$this->assertCacheMissAndReturnResponse($query, [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/UrlResolverCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testUrlResolverCachingForProducts()
2929
$urlKey = 'p002.html';
3030
$urlResolverQuery = $this->getUrlResolverQuery($urlKey);
3131

32-
// Obtain the X-Magento-Cache-Id from the response which will be used as the cache key
32+
// Obtain the X-Magento-Cache-Id from the response
3333
$response = $this->graphQlQueryWithResponseHeaders($urlResolverQuery);
3434
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $response['headers']);
3535
$cacheIdForProducts = $response['headers'][CacheIdCalculator::CACHE_ID_HEADER];
@@ -128,7 +128,7 @@ public function testCacheIsInvalidatedForUrlResolver()
128128
$urlKey = 'p002.html';
129129
$urlResolverQuery = $this->getUrlResolverQuery($urlKey);
130130

131-
// Obtain the X-Magento-Cache-Id from the response which will be used as the cache key
131+
// Obtain the X-Magento-Cache-Id from the response
132132
$response = $this->graphQlQueryWithResponseHeaders($urlResolverQuery);
133133
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $response['headers']);
134134
$cacheIdForUrlResolver = $response['headers'][CacheIdCalculator::CACHE_ID_HEADER];

0 commit comments

Comments
 (0)