Skip to content

Commit

Permalink
temporarily remove code test
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Parrott <[email protected]>
  • Loading branch information
tomponline committed Sep 6, 2024
1 parent fcab49e commit 3554e37
Showing 1 changed file with 28 additions and 69 deletions.
97 changes: 28 additions & 69 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:

env:
CGO_LDFLAGS: "-L/home/runner/go/bin/dqlite-libs/"
LD_LIBRARY_PATH: "/home/runner/go/bin/dqlite-libs/"
CGO_LDFLAGS_ALLOW: "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
LXD_REQUIRED_TESTS: "storage_buckets"
LXD_SKIP_TESTS: "clustering_upgrade clustering_upgrade_large"
Expand All @@ -28,8 +30,6 @@ jobs:
code-tests:
env:
CGO_CFLAGS: "-I/home/runner/work/lxd/lxd-test/vendor/dqlite/include/"
CGO_LDFLAGS: "-L/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
LD_LIBRARY_PATH: "/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
name: Code
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -93,6 +93,14 @@ jobs:
python3 -m pip install flake8
mkdir -p "$(go env GOPATH)/bin"
curl -sSfL https://dl.min.io/server/minio/release/linux-amd64/minio --output "$(go env GOPATH)/bin/minio"
chmod +x "$(go env GOPATH)/bin/minio"
# Also grab the latest minio client to maintain compatibility with the server.
curl -sSfL https://dl.min.io/client/mc/release/linux-amd64/mc --output "$(go env GOPATH)/bin/mc"
chmod +x "$(go env GOPATH)/bin/mc"
- name: Download go dependencies
run: |
set -eux
Expand All @@ -112,68 +120,23 @@ jobs:
set -eux
cd ~/work/lxd/lxd-test
make deps
mv /home/runner/work/lxd/lxd-test/vendor/dqlite/.libs ~/go/bin/dqlite-libs
- name: Run LXD build
run: |
set -eux
make lxd
- name: Check lxc/lxd-agent binary sizes
run: |
set -eux
# Build lxc/lxd-agent the same way as done in the snap
go build -trimpath -o "/tmp/bin/lxc" github.com/canonical/lxd/lxc
CGO_ENABLED=0 go build -trimpath -o "/tmp/bin/lxd-agent" -tags=agent,netgo github.com/canonical/lxd/lxd-agent
strip -s /tmp/bin/*
# bin/max (sizes are in MiB)
SIZES="lxc 15
lxd-agent 12"
MIB="$((1024 * 1024))"
while read -r bin max; do
cur="$(stat --format=%s "/tmp/bin/${bin}")"
min=$((max - 1))
min_mib="$((min * MIB))"
max_mib="$((max * MIB))"
rm -f "/tmp/bin/${bin}"
if [ "${cur}" -gt "${max_mib}" ]; then
echo "FAIL: ${bin} binary size exceeds ${max}MiB"
exit 1
fi
# XXX: check for when we need to lower the min/max sizes
if [ "${cur}" -lt "${min_mib}" ]; then
echo "Congratulations: ${bin} binary size reduced below ${min}MiB"
echo "It is now time to edit the workflow job to use smaller min/max sizes for ${bin}"
exit 1
fi
echo "OK: ${bin} is between ${min} and ${max}MiB"
done <<< ${SIZES}
- name: Run static analysis
env:
GITHUB_BEFORE: ${{ github.event.before }}
run: |
set -eux
sudo chmod o+w ./lxd/metadata/configuration.json
sudo chmod o+w ./doc/metadata.txt
sudo chmod o+w ./po/*
make static-analysis
- name: Unit tests (all)
run: |
set -eux
sudo --preserve-env=CGO_CFLAGS,CGO_LDFLAGS,CGO_LDFLAGS_ALLOW,LD_LIBRARY_PATH LD_LIBRARY_PATH=${LD_LIBRARY_PATH} env "PATH=${PATH}" go test -v ./...
- name: Upload LXD binaries
- name: Upload test binaries
uses: actions/upload-artifact@v4
with:
name: lxd_binaries
path: ~/go/bin/
name: test_deps
path: |
~/go/bin/lxc*
~/go/bin/lxd*
~/go/bin/mc
~/go/bin/minio
~/goh/bin/dqlite_libs
retention-days: 1

system-tests:
Expand Down Expand Up @@ -263,7 +226,6 @@ jobs:
run: |
set -eux
sudo add-apt-repository ppa:ubuntu-lxc/daily -y --no-update
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update
sudo systemctl mask lxc.service lxc-net.service
Expand All @@ -274,7 +236,6 @@ jobs:
libacl1-dev \
libcap-dev \
libdbus-1-dev \
libdqlite-dev \
liblxc-dev \
libseccomp-dev \
libselinux-dev \
Expand Down Expand Up @@ -312,20 +273,18 @@ jobs:
# reclaim some space
sudo apt-get clean
mkdir -p "$(go env GOPATH)/bin"
curl -sSfL https://dl.min.io/server/minio/release/linux-amd64/minio --output "$(go env GOPATH)/bin/minio"
chmod +x "$(go env GOPATH)/bin/minio"
# Also grab the latest minio client to maintain compatibility with the server.
curl -sSfL https://dl.min.io/client/mc/release/linux-amd64/mc --output "$(go env GOPATH)/bin/mc"
chmod +x "$(go env GOPATH)/bin/mc"
- name: Download LXD binaries
- name: Download test binaries
uses: actions/download-artifact@v4
with:
name: lxd_binaries
name: test_deps
merge-multiple: true
path: ~/go/bin/

- name: Set exec perms on LXD binaries
run: |
chmod uog+x ~/go/bin/*
ls -lR ~/go/bin/
- name: Setup MicroCeph
if: ${{ matrix.backend == 'ceph' }}
run: |
Expand Down Expand Up @@ -475,7 +434,7 @@ jobs:
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: ${{ runner.os }}
name: clients-${{ runner.os }}
path: bin/

documentation:
Expand Down

0 comments on commit 3554e37

Please sign in to comment.