File tree Expand file tree Collapse file tree 4 files changed +47
-12
lines changed
specs/ingestion/common/schemas Expand file tree Collapse file tree 4 files changed +47
-12
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ jobs:
286
286
key : node-modules-tests-${{ env.CACHE_VERSION }}-${{ hashFiles('tests/output/javascript/yarn.lock') }}
287
287
288
288
- name : Run CTS
289
- run : yarn cli cts run javascript
289
+ run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
290
290
291
291
- name : Generate code snippets for documentation
292
292
run : yarn cli snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
@@ -372,7 +372,7 @@ jobs:
372
372
run : yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }}
373
373
374
374
- name : Run CTS
375
- run : yarn cli cts run ${{ matrix.client.language }}
375
+ run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }}
376
376
377
377
- name : Generate code snippets for documentation
378
378
run : yarn cli snippets ${{ matrix.client.language }} ${{ matrix.client.toRun }}
Original file line number Diff line number Diff line change @@ -124,16 +124,17 @@ ctsCommand
124
124
. command ( 'run' )
125
125
. description ( 'Run the tests for the CTS' )
126
126
. addArgument ( args . language )
127
+ . addArgument ( args . clients )
127
128
. option ( flags . verbose . flag , flags . verbose . description )
128
- . action ( async ( langArg : LangArg , { verbose } ) => {
129
- const { language } = transformSelection ( {
129
+ . action ( async ( langArg : LangArg , clientArg : string [ ] , { verbose } ) => {
130
+ const { language, clientList } = transformSelection ( {
130
131
langArg,
131
- clientArg : [ ALL ] ,
132
+ clientArg,
132
133
} ) ;
133
134
134
135
setVerbose ( Boolean ( verbose ) ) ;
135
136
136
- await runCts ( language === ALL ? LANGUAGES : [ language ] ) ;
137
+ await runCts ( language === ALL ? LANGUAGES : [ language ] , clientList ) ;
137
138
} ) ;
138
139
139
140
ctsCommand
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as fsp from 'fs/promises';
2
2
3
3
import { run , runComposerInstall , toAbsolutePath } from '../common.js' ;
4
4
import { createSpinner } from '../spinners.js' ;
5
+ import type { Language } from '../types.js' ;
5
6
6
7
import { getTimeoutCounter , startTestServer } from './testServer.js' ;
7
8
@@ -70,16 +71,24 @@ async function runCtsOne(language: string): Promise<void> {
70
71
spinner . succeed ( ) ;
71
72
}
72
73
73
- export async function runCts ( languages : string [ ] ) : Promise < void > {
74
- const close = await startTestServer ( ) ;
75
-
74
+ // the clients option is only used to determine if we need to start the test server, it will run the tests for all clients anyway.
75
+ export async function runCts ( languages : Language [ ] , clients : string [ ] ) : Promise < void > {
76
+ const useTestServer = clients . includes ( 'search' ) ;
77
+ let close : ( ) => Promise < void > = async ( ) => { } ;
78
+ if ( useTestServer ) {
79
+ close = await startTestServer ( ) ;
80
+ }
76
81
for ( const lang of languages ) {
77
82
await runCtsOne ( lang ) ;
78
83
}
79
84
80
- await close ( ) ;
85
+ if ( useTestServer ) {
86
+ await close ( ) ;
81
87
82
- if ( languages . length !== getTimeoutCounter ( ) ) {
83
- throw new Error ( `Expected ${ languages . length } timeout(s), got ${ getTimeoutCounter ( ) } instead.` ) ;
88
+ if ( languages . length !== getTimeoutCounter ( ) ) {
89
+ throw new Error (
90
+ `Expected ${ languages . length } timeout(s), got ${ getTimeoutCounter ( ) } instead.`
91
+ ) ;
92
+ }
84
93
}
85
94
}
Original file line number Diff line number Diff line change @@ -120,12 +120,35 @@ SourceCommercetools:
120
120
default : true
121
121
description : >
122
122
Determines the value that will be stored in the Algolia record if there's no inventory information on the product.
123
+ customFields :
124
+ $ref : ' #/CommercetoolsCustomFields'
123
125
required :
124
126
- url
125
127
- projectKey
126
128
x-discriminator-fields :
127
129
- projectKey
128
130
131
+ CommercetoolsCustomFields :
132
+ type : object
133
+ additionalProperties : false
134
+ description : Custom fields from Commercetools to index in the records (see https://docs.commercetools.com/tutorials/custom-types).
135
+ properties :
136
+ inventory :
137
+ type : array
138
+ items :
139
+ type : string
140
+ description : Inventory custom fields.
141
+ price :
142
+ type : array
143
+ items :
144
+ type : string
145
+ description : Price custom fields.
146
+ category :
147
+ type : array
148
+ items :
149
+ type : string
150
+ description : Category custom fields.
151
+
129
152
SourceBigCommerce :
130
153
type : object
131
154
additionalProperties : false
@@ -347,6 +370,8 @@ SourceUpdateCommercetools:
347
370
Array of locales that must match the following pattern: ^[a-z]{2}(-[A-Z]{2})?$. For example ["fr-FR", "en"].
348
371
items :
349
372
type : string
373
+ customFields :
374
+ $ref : ' #/CommercetoolsCustomFields'
350
375
351
376
SourceUpdateInput :
352
377
oneOf :
You can’t perform that action at this time.
0 commit comments