Skip to content

Commit

Permalink
chore: add load test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Sep 6, 2024
1 parent 58bf5e3 commit f393ac3
Show file tree
Hide file tree
Showing 23 changed files with 2,237 additions and 1 deletion.
120 changes: 120 additions & 0 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: load-tests
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
paths-ignore:
- "**/README.md"
pull_request:
branches: [main]
workflow_dispatch:

jobs:
setup-environment:
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.6"
check-latest: true
cache: false

- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-go-${{ hashFiles('**/go.sum') }}

- name: Install Dependencies
run: make gomoddownload

- name: Install Tools
run: make install-tools

- run: make oteltestbedcol

- name: Upload Testbed Binaries
uses: actions/upload-artifact@v4
with:
name: testbed-binaries
path: ./bin/*

loadtest:
runs-on: ubuntu-22.04
needs: [setup-environment]
strategy:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.6"
check-latest: true
cache: false

- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-go-${{ hashFiles('**/go.sum') }}

- name: Install Dependencies
run: make gomoddownload

- name: Install Tools
run: make install-tools

- name: Cerate results folder
run: mkdir -p results && touch results/TESTRESULTS.md

- name: Download Testbed Binaries
uses: actions/download-artifact@v4
with:
name: testbed-binaries
path: bin/

- name: make Testbet Binaries executable
run: chmod +x bin/*

- name: Loadtest
run: make run-load-tests

# - name: Create Test Result Archive
# if: ${{ failure() || success() }}
# continue-on-error: true
# run: tar -cvf test_results_load-tests.tar internal/testbed/load/tests/results

# - name: Upload Test Results
# if: ${{ failure() || success() }}
# continue-on-error: true
# uses: actions/upload-artifact@v4
# with:
# name: test-result-archive-load-tests
# path: ./*.tar

# - run: cp testbed/tests/results/benchmarks.json testbed/tests/results/load-tests.json

# - name: Upload benchmarks.json
# uses: actions/upload-artifact@v4
# with:
# name: benchmark-results-load-tests
# path: testbed/tests/results/load-tests.json
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,22 @@ chlog-preview: $(CHLOGGEN)
.PHONY: chlog-update
chlog-update: $(CHLOGGEN)
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG) --version $(VERSION)

.PHONY: oteltestbedcol
oteltestbedcol:
cd ./internal/oteltestbedcol && GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ../../bin/oteltestbedcol .

.PHONY: run-load-tests
run-load-tests:
make -C internal/testbed/load run-tests

TOOLS_MOD_DIR := ./internal/tools
TOOLS_MOD_REGEX := "\s+_\s+\".*\""
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"")
TOOLS_BIN_NAMES := $(addprefix .tools/, $(notdir $(TOOLS_PKG_NAMES)))

.PHONY: install-tools
install-tools: $(TOOLS_BIN_NAMES)

.PHONY: gomoddownload
gomoddownload: ./perform_gomod.sh
Empty file.
3 changes: 3 additions & 0 deletions internal/oteltestbedcol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `oteltestbedcol` binary

This folder contains the sources for the `oteltestbedcol` test binary. This binary is intended for **TEST PURPOSES ONLY**. The source files in this folder are **NOT** the ones used to build any official Dynatrace Collector releases.
99 changes: 99 additions & 0 deletions internal/oteltestbedcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f393ac3

Please sign in to comment.