Skip to content

Commit

Permalink
fix: e2e tests (#143)
Browse files Browse the repository at this point in the history
Issue #, if available:

*Description of changes:*
- Fixes e2e tests by restarting BuildKit when containerd is restarted
(similar issue faced in runfinch/finch#461)
- Uses a more up to date yaml file for testing (will automatically
update the OS version too since that's included in the makefile)

*Testing done:*


- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
  • Loading branch information
pendo324 authored Aug 25, 2023
1 parent 88a947c commit 0ab8035
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 270 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ jobs:
os: [[self-hosted, macos, amd64, 13, test], [self-hosted, macos, amd64, 12, test], [self-hosted, macos, arm64, 13, test], [self-hosted, macos, arm64, 12, test]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
submodules: true
- uses: actions/setup-go@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: e2e/go.mod
cache: true
cache-dependency-path: e2e/go.sum
- name: Clean up previous files
shell: zsh {0}
run: |
sudo rm -rf ~/.lima
sudo rm -rf ./_output
Expand All @@ -45,11 +48,17 @@ jobs:
if pgrep '^socket_vmnet'; then
sudo pkill '^socket_vmnet'
fi
- name: Install dependencies
shell: zsh {0}
run: brew install go lz4 automake autoconf libtool
- name: Build project
shell: zsh {0}
run: |
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
which libtool
# Install socket_vmnet to `_output/bin` which is used in $PATH
SOCKET_VMNET_TEMP_PREFIX=$(pwd)/_output/ make lima-socket-vmnet
make install.lima-dependencies
- run: make test-e2e
make install.lima-dependencies binaries
- name: Run e2e tests
shell: zsh {0}
run: make test-e2e
2 changes: 1 addition & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestE2e(t *testing.T) {
t.Fatalf("failed to get the current working directory: %v", err)
}
subject := "limactl"
vmConfigFile := filepath.Join(wd, "./fedora.yaml")
vmConfigFile := filepath.Join(wd, "./../_output/lima-template/fedora.yaml")
vmName := "fedora"
o, err := option.New([]string{subject})

Expand Down
191 changes: 0 additions & 191 deletions e2e/fedora.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/runfinch/common-tests v0.7.1
github.com/runfinch/common-tests v0.7.2
)

require (
Expand Down
4 changes: 2 additions & 2 deletions e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/runfinch/common-tests v0.7.1 h1:MQP1W9n6T6OlZu32uw3efZzdztxj1F4Qa/weKf5Was0=
github.com/runfinch/common-tests v0.7.1/go.mod h1:gweXGeZvwD+YZujYhe12bIXrY8bWQy/43N+GRmZM5I4=
github.com/runfinch/common-tests v0.7.2 h1:LYZkxcFpcsoS4ZiXZ5l4aInncmKere+s5SB89QoJx28=
github.com/runfinch/common-tests v0.7.2/go.mod h1:gweXGeZvwD+YZujYhe12bIXrY8bWQy/43N+GRmZM5I4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand Down
Loading

0 comments on commit 0ab8035

Please sign in to comment.