Skip to content

Commit 92be301

Browse files
rcosta358codex
andcommitted
Assert fresh verification results and cover release versions
Co-authored-by: Codex <noreply@openai.com>
1 parent 3701c13 commit 92be301

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ jobs:
6767
6868
integration:
6969
name: VS Code integration (${{ matrix.version }})
70+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
7071
runs-on: ubuntu-latest
7172
strategy:
7273
fail-fast: false
7374
matrix:
74-
version: ${{ (github.event_name == 'pull_request' || github.ref == 'refs/heads/main') && fromJSON('["stable", "minimum"]') || fromJSON('["stable"]') }}
75+
version: ${{ (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && fromJSON('["stable", "minimum"]') || fromJSON('["stable"]') }}
7576

7677
defaults:
7778
run:

‎client/src/test/smoke.test.ts‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@ suite('Bundled LiquidJava extension', () => {
2121
const file = passing ? 'PassingRefinement.java' : 'FailingRefinement.java';
2222
const uri = vscode.Uri.joinPath(workspace.uri, `src/main/java/${file}`);
2323
const subscriptions: vscode.Disposable[] = [];
24-
const nextFixtureDiagnostics = () => new Promise<LJDiagnostic[]>((resolve) => {
25-
const subscription = api.onDiagnostics((diagnostics) => {
26-
const matches = passing ? diagnostics.length === 0
27-
: diagnostics.some(d => d.type === 'refinement-error' && vscode.Uri.file(path.resolve(d.file)).fsPath === uri.fsPath);
28-
if (matches) {
29-
subscription.dispose();
30-
resolve(diagnostics);
31-
}
24+
const nextFixtureDiagnostics = () => new Promise<LJDiagnostic[]>((resolve, reject) => {
25+
const dispose = () => {
26+
diagnosticsSubscription.dispose();
27+
failureSubscription.dispose();
28+
};
29+
const diagnosticsSubscription = api.onDiagnostics((diagnostics) => {
30+
dispose();
31+
resolve(diagnostics);
3232
});
33-
subscriptions.push(subscription);
33+
const failureSubscription = api.onFailure(() => {
34+
dispose();
35+
reject(new Error(`LiquidJava verifier crashed while checking ${file} (status: ${api.getState().status})`));
36+
});
37+
subscriptions.push(diagnosticsSubscription, failureSubscription);
3438
});
3539
try {
3640
// settle automatic verification before testing the manual command
@@ -47,7 +51,7 @@ suite('Bundled LiquidJava extension', () => {
4751
assert.equal(api.getState().status, 'passed');
4852
} else {
4953
const error = diagnostics.find(d => d.type === 'refinement-error' && vscode.Uri.file(path.resolve(d.file)).fsPath === uri.fsPath);
50-
assert.ok(error);
54+
assert.ok(error, `expected a refinement error for ${file}; received ${JSON.stringify(diagnostics)}`);
5155
assert.equal(error.category, 'error');
5256
assert.equal(error.title, 'Refinement Error');
5357
assert.ok(error.position, 'the diagnostic must identify the invalid assignment');

0 commit comments

Comments
 (0)