Skip to content

[don't merge]Adding test case with ai agent help #1911

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

Conversation

SamYuan1990
Copy link
Collaborator

I know CNCF is not ban either AI Agent or AI copilot, but to be honest to myself, this PR may have risk with AI ethics. I just warning it at the beginning.

Here is how I make this PR.
1st https://github.com/SamYuan1990/kepler/actions/runs/12781054726/job/35628330740
2nd https://github.com/SamYuan1990/kepler/pull/22/files with content here, manual fix at my local.
3th submit the PR here.

as a POC of #1905
with Ricardo Aravena's help, I am going to share this PR on CNCF AI WG meeting at Jan 24 8am PT.

I hope @rootfs , @sunya-ch , @sthaha , @vprashar2929 , @vimalk78 you guys can help with your effort just view added golang file changes.

if we decided to merge the content, I will rebase the file with latest upstream, remove the dummy changes as Tasks.json(which just been invoked as config file for POC but not for kepler's repo).

sunya-ch and others added 30 commits August 21, 2024 16:21
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
…server-patch-1

feat: add --disable-power-meter option
…x-job-flow

fix(ci): ensure independent execution of cleanup and status jobs
…idation

feat: Export validation result as json object.
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
This commit addresses the issue of multiple jobs defined in the
`mock-acpi` workflow, which were unintentionally executing in parallel
due to sequence constraints. By consolidating the workflow into a single
job, we ensure that the tasks are executed sequentially

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
…puting-io/fix-flow

fix(ci): consolidate mock-acpi workflow into single job
Updates:
  * kepler_model_server to 0.7.11-2.
  * Models to 0.7.11 SGDRegressor
  * Adds DISABLE_POWER_METER env to disable power meters when running
    vm compose on a BM (just in case)

Signed-off-by: Sunil Thaha <sthaha@redhat.com>
…ms-0.7.11-2

chore(compose): bumpup model-server to v0.7.11-2
Add cosign to two additional image building workflows to resolve
intermittent signing issue.  Uses GitHub OIDC token for signing,
and narrows scope of privileges to only what is necessary to
write token.

Signed-off-by: Arthur Savage <arthursavage47@gmail.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
  node-exporter provides rapl power metrics
   - node_rapl_core_joules_total
   - node_rapl_uncore_joules_total
   - node_rapl_package_joules_total
   - node_rapl_psys_joules_total

Signed-off-by: Vimal Kumar <vimal78@gmail.com>
…de-exporter

feat(compose): add node-exporter for rapl metrics
This commit bumps the metal runner action version to v0.3.0
It now supports the self-hosted runners at organization level

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
This commit addresses an issue where the codebase was not being checked
out before initiating the runner and setting up the test environment

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
…mp-eq-runner

chore(ci): bump metal runner action version
…x-ch-code

fix(ci): checkout code base earlier
This commit addresses a checkout action failure occurring
in the pull request from forked repos. The issue stemmed from
the use of `ref`. Switching to `sha` resolves this

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
This commit enhances the stress-ng command by adding the
`ackermann` method for CPU stress testing

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
… updates

Bumps the go-dependencies group with 3 updates in the / directory: [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo), [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `github.com/onsi/ginkgo/v2` from 2.20.0 to 2.20.1
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.20.0...v2.20.1)

Updates `github.com/prometheus/client_golang` from 1.20.0 to 1.20.2
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.20.0...v1.20.2)

Updates `golang.org/x/sys` from 0.23.0 to 0.24.0
- [Commits](golang/sys@v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…d-cpu-mthd

chore(validator): add cpu method to stress-ng
…de-exporter

chore(compose): added power source comparison dashboard
dependabot bot and others added 24 commits December 12, 2024 10:09
…e-computing-io#1889)

Bumps the github-actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance), [actions/attest-sbom](https://github.com/actions/attest-sbom) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/checkout` from 3 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](actions/checkout@v3...v4)

Updates `actions/attest-build-provenance` from 1 to 2
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](actions/attest-build-provenance@v1...v2)

Updates `actions/attest-sbom` from 1 to 2
- [Release notes](https://github.com/actions/attest-sbom/releases)
- [Changelog](https://github.com/actions/attest-sbom/blob/main/RELEASE.md)
- [Commits](actions/attest-sbom@v1...v2)

Updates `codecov/codecov-action` from 5.0.7 to 5.1.1
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v5.0.7...v5.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/attest-sbom
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ble-computing-io#1892)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.31.0.
- [Commits](golang/crypto@v0.26.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
…stainable-computing-io#1896)

Bumps the github-actions group with 1 update: [anchore/sbom-action](https://github.com/anchore/sbom-action).


Updates `anchore/sbom-action` from 0.17.8 to 0.17.9
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](anchore/sbom-action@v0.17.8...v0.17.9)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit updates the rpm volume mounts to match to specific
requirements of Kepler

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
Add TLS support via the new web configuration file, following the
Prometheus Exporter Toolkit style for consistency across exporters.

* Usage:

kepler --web.config.file=web-config.yml

* Content of web-config.yml:

tls_server_config:
  cert_file: /path/to/server.crt
  key_file: /path/to/server.key

Signed-off-by: Anthony Harivel <aharivel@redhat.com>
…e-computing-io#1900)

Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/upload-artifact` from 4.4.3 to 4.5.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4.4.3...v4.5.0)

Updates `codecov/codecov-action` from 5.1.1 to 5.1.2
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…puting-io#1903)

This commit updates the `GITHUB_TOKEN` permission for the unit test workflow.

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
feat: add TLS endpoint to kepler exporter
Signed-off-by: Witek Bedyk <witold.bedyk@suse.com>
…-net

Bump golang.org/x/net from 0.28.0 to 0.34.0
…ore-rpm

chore: align rpm volume mounts with Kepler requirements
…sustainable-computing-io#1909)

Bumps the github-actions group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
Signed-off-by: Sam Yuan <yy19902439@126.com>
@SamYuan1990 SamYuan1990 changed the title Adding test case with ai agent help [don't merge]Adding test case with ai agent help Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: This pull request introduces a proof-of-concept for adding test cases using an AI agent in the Kepler project. The changes include new test files for the Exporter package, AppConfig, HealthProbe, and RootHandler functions, as well as a test case for the HandleInactiveContainers function in the collector package.

Key Modifications:

  • Added a JSON file with tasks for generating unit tests and benchmark tests in Golang using the Ginkgo framework and regex matching.
  • Introduced new test files for the Exporter package, AppConfig, HealthProbe, and RootHandler functions.
  • Added a test case for the HandleInactiveContainers function in the collector package.

Impact on Codebase: The changes do not alter the signatures of exported functions, global data structures, or variables, and do not introduce any visible changes to the external interface or behavior of the code.

Observations/Suggestions:

  • The addition of test cases using an AI agent is a great step towards improving the project's test coverage and reliability.
  • It would be beneficial to consider integrating the AI agent-generated tests into the existing testing framework to ensure seamless execution and reporting.
  • Further review and refinement of the test cases may be necessary to ensure they are comprehensive and effective in covering the desired functionality.

@rootfs
Copy link
Contributor

rootfs commented Jan 22, 2025

@SamYuan1990 can you check if generated code is in line with CNCF guideline? cc @caniszczyk

@SamYuan1990
Copy link
Collaborator Author

@SamYuan1990 can you check if generated code is in line with CNCF guideline? cc @caniszczyk

well, where are the specific terms ?
and I also want to know if we make a github action, which:

  • figure out as which specific function leaking/need improve unit test coverage.
  • figure out as which specific function leaking/need improve code document coverage.
    and provide an optional feature as suggestion by LLM.
    or any kind of threshold, if the test coverage lower than threshold(for example 10%)... to enable feature as suggestion by LLM.
    makes user enable the feature by settings, also provides full log for trace.
    if the feature been enabled, then action will invoke LLM try to auto generate code/doc, then PR back as suggestion.
    after that, similar to a lint failure for dependency bot auto bump up, a maintainer will jump in, check LLM's suggestion, fix any breaks locally and get things done.
    in this case, which terms should we check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.