-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add end to end tests #51
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rhcos-live.x86_64.iso | ||
**/*iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,11 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install libvirt-dev | ||
|
||
- name: Prepare | ||
run: | | ||
make generate | ||
|
@@ -36,6 +41,11 @@ jobs: | |
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install libvirt-dev | ||
|
||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Run e2e test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
MIGRATION_PLANNER_API_IMAGE: "custom/migration-planner-api" | ||
MIGRATION_PLANNER_API_IMAGE_PULL_POLICY: "Never" | ||
PODMAN: "docker" | ||
|
||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: true | ||
swap-storage: true | ||
|
||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set env variables | ||
run: | | ||
export "REGISTRY_IP=$(ip addr show eth0 | grep -oP '(?<=inet\s)\d+\.\d+\.\d+\.\d+')" | ||
echo "REGISTRY_IP=${REGISTRY_IP}" >> $GITHUB_ENV | ||
echo "MIGRATION_PLANNER_AGENT_IMAGE=${REGISTRY_IP}:5000/agent" >> $GITHUB_ENV | ||
echo "INSECURE_REGISTRY=${REGISTRY_IP}:5000" >> $GITHUB_ENV | ||
|
||
- name: Ignore insecure registry | ||
run: | | ||
cat << EOF > daemon.json | ||
{ | ||
"insecure-registries" : [ "${INSECURE_REGISTRY}" ] | ||
} | ||
EOF | ||
sudo mv daemon.json /etc/docker/daemon.json | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart docker | ||
|
||
- name: Install kubectl | ||
uses: azure/setup-kubectl@v4 | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/kind-action@v1 | ||
with: | ||
cluster_name: kind | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install sshpass libvirt-dev libvirt-daemon libvirt-daemon-system | ||
sudo systemctl restart libvirtd | ||
|
||
- name: Deploy vcsim | ||
run: | | ||
kubectl create deployment vcsim --image=docker.io/vmware/vcsim | ||
kubectl wait --for=condition=Ready pods --all --timeout=240s | ||
kubectl port-forward --address 0.0.0.0 deploy/vcsim 8989:8989 & | ||
|
||
- name: Deploy registry | ||
run: | | ||
kubectl create deployment registry --image=docker.io/registry | ||
kubectl wait --for=condition=Ready pods --all --timeout=240s | ||
kubectl port-forward --address 0.0.0.0 deploy/registry 5000:5000 & | ||
|
||
- name: Build assisted-migration containers | ||
run: | | ||
make migration-planner-agent-container MIGRATION_PLANNER_AGENT_IMAGE=$MIGRATION_PLANNER_AGENT_IMAGE | ||
make migration-planner-api-container MIGRATION_PLANNER_API_IMAGE=$MIGRATION_PLANNER_API_IMAGE | ||
docker push $MIGRATION_PLANNER_AGENT_IMAGE | ||
kind load docker-image $MIGRATION_PLANNER_API_IMAGE | ||
docker rmi $MIGRATION_PLANNER_API_IMAGE | ||
|
||
- name: Deploy assisted-migration | ||
run: | | ||
make deploy-on-kind MIGRATION_PLANNER_API_IMAGE=$MIGRATION_PLANNER_API_IMAGE MIGRATION_PLANNER_AGENT_IMAGE=$MIGRATION_PLANNER_AGENT_IMAGE MIGRATION_PLANNER_API_IMAGE_PULL_POLICY=$MIGRATION_PLANNER_API_IMAGE_PULL_POLICY INSECURE_REGISTRY=$INSECURE_REGISTRY | ||
kubectl wait --for=condition=Ready pods --all --timeout=240s | ||
kubectl port-forward --address 0.0.0.0 service/migration-planner-agent 7443:7443 & | ||
kubectl port-forward --address 0.0.0.0 service/migration-planner 3443:3443 & | ||
|
||
- name: Run test | ||
run: | | ||
sudo make integration-test PLANNER_IP=${REGISTRY_IP} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Running integration tests | ||
The integration tests are executed against deployed `planner-api`. The planner api can be deployed | ||
as container or running as binary. | ||
|
||
## Requiremets | ||
|
||
``` | ||
dnf install -y libvirt-devel | ||
sudo usermod -a -G libvirt $USER | ||
``` | ||
|
||
Running planner api, either as container or binary: | ||
``` | ||
bin/planner-api | ||
``` | ||
|
||
## Executing tests | ||
``` | ||
PLANNER_IP=1.2.3.4 make integration-tests | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<domain type='kvm'> | ||
<name>coreos-vm</name> | ||
<memory unit='MiB'>4096</memory> | ||
<vcpu placement='static'>2</vcpu> | ||
<metadata> | ||
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | ||
<libosinfo:os id="http://fedoraproject.org/coreos/stable"/> | ||
</libosinfo:libosinfo> | ||
</metadata> | ||
<os> | ||
<type arch='x86_64' machine='pc-q35-6.2'>hvm</type> | ||
<boot dev='cdrom'/> | ||
</os> | ||
<cpu mode='host-passthrough' check='none' migratable='on'/> | ||
<features> | ||
<acpi/> | ||
<apic/> | ||
</features> | ||
<devices> | ||
<emulator>/usr/bin/qemu-system-x86_64</emulator> | ||
<disk type='file' device='cdrom'> | ||
<driver name='qemu' type='raw'/> | ||
<source file='/tmp/agent.iso'/> | ||
<target dev='sda' bus='sata'/> | ||
<readonly/> | ||
</disk> | ||
<interface type='network'> | ||
<source network='default'/> | ||
<model type='virtio'/> | ||
</interface> | ||
<graphics type='vnc' port='-1'/> | ||
<console type='pty'/> | ||
</devices> | ||
</domain> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍