Add support for a new curve data format in the Curves package converter system
日本語の概要は準備中です。原文の説明を表示しています。
Add unit tests to a Datagrok package
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Add unit tests to a Datagrok package using the platform's custom test framework.
/add-package-tests [package-path]
When this skill is invoked, help the user set up and write tests for a Datagrok package.
For a new package with tests:
grok create <package-name> --test
For an existing package:
cd <package-name>
grok add tests
npm install
Create a src/tests/ directory. Each file covers one test category.
import {category, expect, test} from '@datagrok-libraries/utils/src/test';
category('MyCategory', () => {
test('should do something', async () => {
expect(actualValue, expectedValue);
});
test('should handle edge case', async () => {
// Test logic
expect(result, true);
});
});
Key test framework functions:
category(name, fn) - groups related teststest(name, fn, options?) - defines a single test caseexpect(actual, expected) - assertion that checks equalityImport all test files in src/package-test.ts:
import './tests/my-category-tests';
import './tests/another-category-tests';
Use the skipReason parameter to temporarily skip a test (always provide a reason such as a Jira ticket):
test('flaky test', async () => {
expect(1, 11);
}, {skipReason: 'GROK-99999'});
For simple functions, add test cases directly in the function annotation using the test parameter:
//name: square
//input: int x
//output: int y
//test: square(1) == 1
//test: square(2) == 4
//test: square(3) == 9
export function square(x: number): number {
return x ** 2;
}
Supported parameter types for //test: annotations: int, double, bool, string, datetime, map. Types like dataframe, column_list, column, file, blob require an additional helper function call.
# Local testing with datagrok-tools
grok test
# Against a specific server
grok test --host dev
# With visible browser
grok test --gui
# Specific category or test
grok test --category "MyCategory"
grok test --test "should do something"
Tests can also be run from the Datagrok console or Test Manager in the platform UI.
category, test, expect from @datagrok-libraries/utils/src/testsrc/package-test.tsskipReason with a Jira key (e.g., GROK-12345) when skipping tests//test: annotation on functions is for simple input/output validationpublic/packages/Chem/src/package-test.ts, src/tests/)grok add testscategory and test blocks for the functionality the user wants to testsrc/package-test.tsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Add support for a new curve data format in the Curves package converter system
日本語の概要は準備中です。原文の説明を表示しています。
Create info panels that appear in the context panel based on semantic types
日本語の概要は準備中です。原文の説明を表示しています。
Add a new single-objective optimization algorithm to the sci-comp library. Use when the user asks to implement a new optimizer (e.g. gradient descent, BFGS, simulated annealing, differential evolution).
日本語の概要は準備中です。原文の説明を表示しています。
Answer a "how do I …" question about the platform with a Gherkin scenario on @datagrok-libraries/bdd that is filmed into a how-to video (grok-bdd guide), so the answer is demonstrated, sent as a video plus numbered steps, and kept as a regression test
日本語の概要は準備中です。原文の説明を表示しています。
Translate hand-written Playwright specs (or any existing UI tests) into Gherkin features on @datagrok-libraries/bdd, then prove the features test what they claim by backward-matching them against the originals with independent reviewers, and fix the gaps in the core, the library and the features
日本語の概要は準備中です。原文の説明を表示しています。
Create a Datagrok application with routing, views, and data access
日本語の概要は準備中です。原文の説明を表示しています。