Skip to content

Commit 14aeedd

Browse files
authored
Merge pull request #74 from t-unit/platform-support
Better platform support and documenation
2 parents 2ae41f0 + d612c74 commit 14aeedd

File tree

25 files changed

+120
-50
lines changed

25 files changed

+120
-50
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
sdk: [stable, beta]
15-
fail-fast: false
14+
include:
15+
- os: ubuntu-latest
16+
sdk: stable
17+
- os: macos-latest
18+
sdk: stable
19+
- os: windows-latest
20+
sdk: stable
21+
- os: ubuntu-latest
22+
sdk: beta
23+
fail-fast: true
1624

1725
steps:
1826
- uses: actions/checkout@v6
@@ -30,6 +38,7 @@ jobs:
3038
3139
- name: Setup integration test
3240
run: ./scripts/setup_integration_tests.sh
41+
shell: bash
3342

3443
- name: Run tests with coverage
3544
run: melos run test:coverage
@@ -142,7 +151,7 @@ jobs:
142151
dart pub get
143152
dart test --concurrency=1
144153
- name: Format and merge coverage reports
145-
if: matrix.sdk == 'stable'
154+
if: matrix.sdk == 'stable' && matrix.os == 'ubuntu-latest'
146155
run: |
147156
# Ensure output directory exists before format_coverage writes files
148157
mkdir -p coverage
@@ -187,7 +196,7 @@ jobs:
187196
cat coverage/*.lcov.info > coverage/lcov.info 2>/dev/null || echo "No coverage files found"
188197
189198
- name: Upload coverage to Codecov
190-
if: matrix.sdk == 'stable'
199+
if: matrix.sdk == 'stable' && matrix.os == 'ubuntu-latest'
191200
uses: codecov/codecov-action@v5
192201
with:
193202
files: ./coverage/lcov.info

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Behaviour",
99
"Blub",
1010
"cbor",
11+
"codegen",
1112
"codegeneration",
1213
"endpointcost",
1314
"fastify",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
include: package:very_good_analysis/analysis_options.yaml
2+
3+
linter:
4+
rules:
5+
avoid_print: false

integration_test/binary_models/binary_models_test/imposter/response.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Get the response status from the request header
2-
def responseStatus = context.request.headers['X-Response-Status'] ?: '200'
2+
def headers = context.request.headers
3+
def responseStatus = headers['X-Response-Status'] ?: headers['x-response-status'] ?: '200'
34

45
// Set the response based on path and status
56
def response = respond().withStatusCode(Integer.parseInt(responseStatus))

integration_test/binary_models/binary_models_test/test/content_media_type_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ void main() {
7777
// Serialize to JSON
7878
final json = imageEncodedData.toJson()! as Map<String, dynamic>;
7979

80-
// The schema has contentEncoding: base64, but this test uses ASCII-compatible
81-
// bytes that are valid UTF-8 to demonstrate the bidirectional conversion.
82-
// In this test, List<int> is decoded as UTF-8 string in JSON for simplicity.
80+
// The schema has contentEncoding: base64, but this test uses
81+
// ASCII-compatible bytes that are valid UTF-8 to demonstrate the
82+
// bidirectional conversion. In this test, List<int> is decoded as UTF-8
83+
// string in JSON for simplicity.
8384
expect(json['imageData'], isA<String>());
8485
expect(json['imageData'], equals('Hello'));
8586
});

integration_test/binary_models/binary_models_test/test/test_helper.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:convert';
23
import 'dart:io';
34

45
import 'package:path/path.dart' as path;
@@ -36,6 +37,13 @@ class ImposterServer {
3637
],
3738
);
3839

40+
_process!.stdout.transform(const Utf8Decoder()).listen((data) {
41+
print('Imposter stdout: $data');
42+
});
43+
_process!.stderr.transform(const Utf8Decoder()).listen((data) {
44+
print('Imposter stderr: $data');
45+
});
46+
3947
// Wait for server to be ready
4048
await _waitForServer();
4149
}

integration_test/boolean_schemas/boolean_schemas_test/imposter/response.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import groovy.json.JsonSlurper
22
import groovy.json.JsonOutput
33

44
// Get the response status from the request header
5-
def responseStatus = context.request.headers['X-Response-Status'] ?: '200'
5+
def headers = context.request.headers
6+
def responseStatus = headers['X-Response-Status'] ?: headers['x-response-status'] ?: '200'
67

78
// Set the response status code
89
def response = respond()

integration_test/fastify_type_provider_zod/fastify_type_provider_zod_test/imposter/response.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Get the response status from the request header
2-
def responseStatus = context.request.headers['X-Response-Status'] ?: '200'
2+
def headers = context.request.headers
3+
def responseStatus = headers['X-Response-Status'] ?: headers['x-response-status'] ?: '200'
34

45
// Set the response status code and use the OpenAPI specification
56
respond()

integration_test/gov/gov_test/imposter/response.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Get the response status from the request header
2-
def responseStatus = context.request.headers['X-Response-Status'] ?: '200'
2+
def headers = context.request.headers
3+
def responseStatus = headers['X-Response-Status'] ?: headers['x-response-status'] ?: '200'
34

45
// Set the response status code and use the OpenAPI specification
56
respond()

integration_test/inference/inference_test/imposter/response.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Get the response status from the request header
2-
def responseStatus = context.request.headers['X-Response-Status'] ?: '200'
2+
def headers = context.request.headers
3+
def responseStatus = headers['X-Response-Status'] ?: headers['x-response-status'] ?: '200'
34
def statusCode = Integer.parseInt(responseStatus)
45
def path = context.request.path
56
def method = context.request.method

0 commit comments

Comments
 (0)