Skip to content

Commit

Permalink
CI: use self-hosted runner to run tests
Browse files Browse the repository at this point in the history
Use prepared VM machine in GitHub actions to run mdadm tests on it.

Signed-off-by: Kinga Stefaniuk <[email protected]>
  • Loading branch information
ktanska committed Oct 18, 2024
1 parent 1a5787d commit b33aa21
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/tools/run_mdadm_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash

sudo make clean
sudo make -j$(nproc)
sudo make install
sudo mdadm -Ss
sudo ./test setup
sudo ./test --skip-broken --no-error --disable-integrity --disable-multipath --disable-linear --keep-going
sudo ./test cleanup
49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: review
on:
pull_request:
paths:
- '*.c'
- '*.h'
jobs:
upstream_tests:
if: ${{ github.repository == 'md-raid-utilities/mdadm' }}
runs-on: self-hosted
timeout-minutes: 120
name: upstream tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 'Prepare machine'
run: |
cd ..
vagrant halt
vagrant status
vagrant up
- name: 'Run tests'
run: |
cd ..
vagrant ssh -c "cd /home/vagrant/host/mdadm && .github/tools/run_mdadm_tests.sh"
- name: 'Copy logs to host machine'
run: |
cd ..
vagrant ssh -c "sudo mkdir /home/vagrant/host/logs && mv /var/tmp/*.log /home/vagrant/host/logs"
- name: "Save artifacts"
uses: actions/upload-artifact@v4
with:
name: "Logs from failed tests"
path: /home/vagrant/host/logs/*.log
- name: "Clean logs"
run: |
cd ..
vagrant ssh -c "sudo rm -r /home/vagrant/host/logs"
cleanup:
runs-on: self-hosted
steps:
- name: Restore clean VM
run: |
cd ..
vagrant ssh -c "sudo mdadm -Ss"
vagrant halt
1 change: 1 addition & 0 deletions super-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -12400,6 +12400,7 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
close(fd);
return -1;
}
// test

rc = read_completed(fd, &completed);
if (rc < 0) {
Expand Down
1 change: 1 addition & 0 deletions tests/07layouts.broken
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
always fails

0 comments on commit b33aa21

Please sign in to comment.