Skip to content

cannier: implement parts (features, model, test set) #3930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

dhiller
Copy link
Contributor

@dhiller dhiller commented Jan 30, 2025

What this PR does / why we need it:

Implements the code parts required for the CANNIER approach 1 .

Creates cannier subcommands required to execute:

  • extract
    • features - extracts the feature vector from the test code for a given test case
      • extraction code done
      • feature extraction fully implemented
    • testname - extracts the names for the changed ginkgo tests for a range of commits
  • generate
    • model - generates the random forest model from a set of test cases
  • host
    • model

Defines the format of the feature vector. Note: most of the values returned are mocked currently.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jan 30, 2025
@dhiller dhiller force-pushed the cannier-feature-set-extractor branch from ec5314b to b88bb00 Compare February 20, 2025 13:56
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2025
@dhiller dhiller force-pushed the cannier-feature-set-extractor branch from b88bb00 to 3f3bfbd Compare February 27, 2025 17:56
dhiller added 17 commits March 28, 2025 14:17
Creates the first command `cannier extract` that defines the interface
of the feature vector.

Nearly all of the values returned are mocked.

Signed-off-by: Daniel Hiller <[email protected]>
Adds retrieval of the ast.CallExpr that is the test
declaration by name.

Refactoring: moves outline generation into robots/pkg/ginkgo

Signed-off-by: Daniel Hiller <[email protected]>
initial approach to generate classification for test flakiness

Signed-off-by: Daniel Hiller <[email protected]>
also finding test file by test name now works

Signed-off-by: Daniel Hiller <[email protected]>
We now have the commands:

* `generate model` - saves the model data to disk
* `generate classes`
* `host model` - takes a data file and serves the model

Signed-off-by: Daniel Hiller <[email protected]>
plan: create a GET handler that gives a statistical overview about the
model data, i.e.
* number of classes and their appearance
* min, max, average of each feature

Signed-off-by: Daniel Hiller <[email protected]>
adds a handler for /stats that emits statistics for the model data.

Signed-off-by: Daniel Hiller <[email protected]>
Since we can't rely on the name alone we add support for finding tests
by test_id.

Signed-off-by: Daniel Hiller <[email protected]>
Signed-off-by: Daniel Hiller <[email protected]>
Creates the required data we need for mapping tests towards file
changes.

This change holds an automatic expansion of a git repository inside
testdata so that we can unit test git operations.

Also updates the unit tests for blame.

Signed-off-by: Daniel Hiller <[email protected]>
Adds the `extract changed-tests` command which determines for a given
revision range the changes to tests inside a code base.

Output is the names of the changed tests as well as the ginkgo node data
for the paths to each changed test. Paths are expanded from the ginkgo
tree, which means each path describes exactly one test.

Signed-off-by: Daniel Hiller <[email protected]>
Signed-off-by: Daniel Hiller <[email protected]>
Signed-off-by: Daniel Hiller <[email protected]>
@dhiller dhiller force-pushed the cannier-feature-set-extractor branch from 3f3bfbd to e3dcea7 Compare March 28, 2025 13:19
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 28, 2025
@dhiller dhiller force-pushed the cannier-feature-set-extractor branch from e3dcea7 to 1f49a89 Compare March 28, 2025 13:19
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign enp0s3 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dhiller dhiller force-pushed the cannier-feature-set-extractor branch 2 times, most recently from 2dcc37d to bfa5f23 Compare March 28, 2025 13:25
@dhiller dhiller force-pushed the cannier-feature-set-extractor branch from bfa5f23 to a1ef64e Compare March 28, 2025 13:25
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2025
@kubevirt-bot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants