Skip to content

Commit a1dbe5f

Browse files
committed
fix: skip custom tests
1 parent d9a9d10 commit a1dbe5f

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
targets:
2+
$default:
3+
builders:
4+
json_serializable:
5+
options:
6+
any_map: false
7+
checked: true
8+
create_factory: true
9+
create_to_json: true
10+
disallow_unrecognized_keys: false
11+
explicit_to_json: true
12+
field_rename: none
13+
ignore_unannotated: false
14+
include_if_null: false

clients/algoliasearch-client-php/lib/Algolia.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
namespace Algolia\AlgoliaSearch;
44

55
use Algolia\AlgoliaSearch\Cache\NullCacheDriver;
6-
use Algolia\AlgoliaSearch\Http\CurlHttpClient;
7-
use Algolia\AlgoliaSearch\Http\GuzzleHttpClient;
86
use Algolia\AlgoliaSearch\Http\HttpClientInterface;
97
use Algolia\AlgoliaSearch\Log\DebugLogger;
10-
use GuzzleHttp\Client;
11-
use GuzzleHttp\ClientInterface;
128
use Psr\Log\LoggerInterface;
139
use Psr\SimpleCache\CacheInterface;
1410

@@ -19,19 +15,19 @@ final class Algolia
1915
/**
2016
* Holds an instance of the simple cache repository (PSR-16).
2117
*
22-
* @var null|CacheInterface
18+
* @var null|\Psr\SimpleCache\CacheInterface
2319
*/
2420
private static $cache;
2521

2622
/**
2723
* Holds an instance of the logger (PSR-3).
2824
*
29-
* @var null|LoggerInterface
25+
* @var null|\Psr\Log\LoggerInterface
3026
*/
3127
private static $logger;
3228

3329
/**
34-
* @var HttpClientInterface
30+
* @var \Algolia\AlgoliaSearch\Http\HttpClientInterface
3531
*/
3632
private static $httpClient;
3733

@@ -47,7 +43,7 @@ public static function isCacheEnabled()
4743
/**
4844
* Gets the cache instance.
4945
*
50-
* @return CacheInterface
46+
* @return \Psr\SimpleCache\CacheInterface
5147
*/
5248
public static function getCache()
5349
{
@@ -69,7 +65,7 @@ public static function setCache(CacheInterface $cache)
6965
/**
7066
* Gets the logger instance.
7167
*
72-
* @return LoggerInterface
68+
* @return \Psr\Log\LoggerInterface
7369
*/
7470
public static function getLogger()
7571
{
@@ -94,23 +90,23 @@ public static function getHttpClient()
9490
if (interface_exists('\GuzzleHttp\ClientInterface')) {
9591
if (defined('\GuzzleHttp\ClientInterface::VERSION')) {
9692
$guzzleVersion = (int) mb_substr(
97-
Client::VERSION,
93+
\GuzzleHttp\Client::VERSION,
9894
0,
9995
1
10096
);
10197
} else {
102-
$guzzleVersion = ClientInterface::MAJOR_VERSION;
98+
$guzzleVersion = \GuzzleHttp\ClientInterface::MAJOR_VERSION;
10399
}
104100
}
105101

106102
if (null === self::$httpClient) {
107103
if (class_exists('\GuzzleHttp\Client') && 6 <= $guzzleVersion) {
108104
self::setHttpClient(
109-
new GuzzleHttpClient()
105+
new \Algolia\AlgoliaSearch\Http\GuzzleHttpClient()
110106
);
111107
} else {
112108
self::setHttpClient(
113-
new CurlHttpClient()
109+
new \Algolia\AlgoliaSearch\Http\CurlHttpClient()
114110
);
115111
}
116112
}

generators/src/main/java/com/algolia/codegen/cts/tests/TestsClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ public void run(Map<String, CodegenModel> models, Map<String, CodegenOperation>
107107
} else if (step.type.equals("method")) {
108108
ope = operations.get(step.method);
109109
if (ope == null) {
110+
// some clients don't have custom methods
111+
if (step.method.startsWith("custom") && client.equals("composition")) {
112+
continue skipTest;
113+
}
114+
110115
throw new CTSException("Cannot find operation for method: " + step.method, test.testName);
111116
}
112117
stepOut.put("stepTemplate", "tests/client/method.mustache");

specs/composition/spec.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ x-tagGroups:
4747
tags:
4848
- Compositions
4949
paths:
50-
# ######################
51-
# ### Custom request ###
52-
# ######################
53-
/{path}:
54-
$ref: '../common/paths/customRequest.yml'
55-
5650
# ########################
5751
# ### Search Endpoints ###
5852
# ########################

0 commit comments

Comments
 (0)