Skip to content

Commit

Permalink
[DPE-4779] Add Kraft test (#43)
Browse files Browse the repository at this point in the history
* add kraft test
  • Loading branch information
zmraul authored Jul 18, 2024
1 parent c266f9c commit b57294b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
snap-file: ${{ steps.snapcraft.outputs.snap }}
version: ${{ steps.get-version.outputs.version }}

test:
name: Test Snap
test-with-zk:
name: Test Snap with ZooKeeper
runs-on: ubuntu-latest
needs:
- build
Expand Down Expand Up @@ -87,3 +87,39 @@ jobs:
sudo snap start charmed-kafka.cruise-control
sleep 20
curl -s http://localhost:9090/kafkacruisecontrol/state | grep "state: RUNNING"
test-with-kraft:
name: Test Snap with Kraft
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download snap file
uses: actions/download-artifact@v3
with:
name: charmed-kafka_snap_amd64
path: .

- name: Install snap file
run: |
sudo snap install charmed-kafka_${{ needs.build.outputs.version }}_amd64.snap --dangerous
- name: Set default kraft config
run: |
sudo cp /snap/charmed-kafka/current/opt/kafka/config/kraft/server.properties /var/snap/charmed-kafka/current/etc/kafka
sudo sed -i '/log.dirs=/c\log.dirs=/var/snap/charmed-kafka/common/var/log/kafka' /var/snap/charmed-kafka/current/etc/kafka/server.properties
uuid=$(sudo charmed-kafka.storage random-uuid)
sudo charmed-kafka.storage format --cluster-id $uuid -c /var/snap/charmed-kafka/current/etc/kafka/server.properties
- name: Start snap services
run: |
sudo snap start charmed-kafka.daemon
sleep 5
- name: Check topic creation
run: |
topic_creation=$(charmed-kafka.topics --create --topic test --bootstrap-server localhost:9092)
if [ "$topic_creation" != "Created topic test." ]; then
exit 1
fi
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ apps:
- network-bind
- mount-observe
environment:
bin_script: storage.sh
bin_script: kafka-storage.sh
consumer-perf-test:
command: opt/kafka/bin/bin-wrapper.bash
plugs:
Expand Down

0 comments on commit b57294b

Please sign in to comment.