Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and run e2e tests

on: # yamllint disable-line rule:truthy
pull_request:

# default permissions as read only
permissions: read-all

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- name: checkout source
uses: actions/checkout@v6

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue

- name: filter changes
uses: dorny/paths-filter@v3

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
id: filter
with:
filters: |
changes:
- 'cmd/**/*.go'
- 'internal/**/*.go'
- 'config/**/*.go'
- 'test/**/*'
- 'go.mod'
- 'go.sum'
- '.github/workflows/k8s-bm.yaml'

build-and-deploy:
needs: [check-changes]
if: needs.check-changes.outputs.changes == 'true' && github.repository_owner == 'sustainable-computing-io'
runs-on: self-hosted
steps:
# NOTE: In case of self-hosted runners, tools like docker, make, kubectl etc. are installed at the time of setting up the runner.
# Hence, we don't need to install them as part of the job.
- name: Checkout source
uses: actions/checkout@v6

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Go
uses: actions/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
go-version-file: go.mod
cache: false

- name: Build Kepler and e2e binary
shell: bash
run: |
make test-e2e

- name: Run e2e tests
shell: bash
run: |
sudo ./bin/kepler-e2e.test -test.v -test.timeout=15m
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,24 @@ test: ## Test with race detection and coverage
coverage: test ## Coverage report generation (HTML)
$(GOCMD) tool cover -html=$(COVER_PROFILE) -o $(COVER_HTML)

# Build e2e test binary
.PHONY: test-e2e
test-e2e: build ## Build e2e test binary (run with sudo separately)
@echo "Building e2e test binary..."
CGO_ENABLED=1 $(GOTEST) -race -c -o $(BINARY_DIR)/kepler-e2e.test ./test/e2e
@echo ""
@echo "E2E test binary built: $(BINARY_DIR)/kepler-e2e.test"
@echo ""
@echo "To run (requires root for RAPL access):"
@echo " sudo ./$(BINARY_DIR)/kepler-e2e.test -test.v"
@echo ""
@echo "Optional flags:"
@echo " -kepler.binary=/path/to/kepler"
@echo " -kepler.port=9999"
@echo " -kepler.config=/path/to/config"
@echo ""
@echo "Prerequisites: Intel RAPL, stress-ng (for workload tests)"

# Generate metrics documentation
.PHONY: gen-metrics-docs
gen-metrics-docs: ## Documentation generation for metrics
Expand Down
Loading
Loading