Skip to content

Commit

Permalink
Squashed commit message for the first 10 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
sky1122 committed Nov 26, 2024
1 parent f6d4223 commit 099c8b1
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/e2e-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
sudo systemctl start finch.service
sudo systemctl start finch-buildkit.service
sudo systemctl start finch-soci.service
- name: Set up REPORT_DIR
run: |
echo "REPORT_DIR=${{ github.workspace }}/reports" >> $GITHUB_ENV
- name: Run e2e tests
run: |
git status
Expand All @@ -98,6 +101,44 @@ jobs:
eval "$(ssh-agent -s)"
INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} sudo -E make test-e2e-container
INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} sudo -E make test-e2e-vm
- name: Change ownership of reports
if: always()
run: |
if [ ! -d "$REPORT_DIR" ]; then
echo "Error: Directory $REPORT_DIR does not exist."
exit 1
fi
USER=$(whoami)
GROUP=$(id -gn)
if sudo chown -R "$USER:$GROUP" "$REPORT_DIR"; then
echo "Ownership of $REPORT_DIR changed to $USER:$GROUP"
else
echo "Error: Failed to change ownership of $REPORT_DIR"
exit 1
fi
- name: Check and upload e2e tests reports to s3 bucket
if: ${{ steps.vars.outputs.has_creds == true && (!(startsWith(inputs.os, 'amazon') && inputs.version == '2' ))}}
run: |
VM_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
CONTAINER_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
if [ -f "$VM_REPORT" ]; then
echo "VM report file exists. Uploading to S3..."
aws s3 cp "$VM_REPORT" "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
echo "VM report uploaded successfully."
else
echo "VM report file does not exist. Skipping upload."
fi
if [ -f "$CONTAINER_REPORT" ]; then
echo "Container report file exists. Uploading to S3..."
aws s3 cp "$CONTAINER_REPORT" "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
echo "Container report uploaded successfully."
else
echo "Container report file does not exist. Skipping upload."
fi
- name: Clean up repo AL2
if: ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' && always() ) }}
run: |
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/e2e-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ jobs:
echo "has_creds=$has_creds" >> $GITHUB_OUTPUT
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
if: ${{ steps.vars.outputs.has_creds == true }}
if: ${{ steps.vars.outputs.has_creds == 'true' }}
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: credhelper-test
aws-region: ${{ secrets.REGION }}
aws-region: ${{ secrets.REGION }}
- name: Clean up previous files
run: |
sudo rm -rf /opt/finch
Expand All @@ -68,7 +68,7 @@ jobs:
fi
if pgrep '^socket_vmnet'; then
sudo pkill '^socket_vmnet'
fi
fi
- name: Install Rosetta 2
run: echo "A" | softwareupdate --install-rosetta || true
- run: brew install lz4 automake autoconf libtool yq
Expand All @@ -84,3 +84,33 @@ jobs:
git clean -f -d
REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} make ${{ inputs.test-command }}
shell: zsh {0}
- name: Check and upload e2e tests reports to s3 bucket
if: always()
run: |
VM_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
CONTAINER_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
VM_SERIAL_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-serial-report.json"
if [ -f "$VM_REPORT" ]; then
echo "VM report file exists. Uploading to S3..."
aws s3 cp "$VM_REPORT" "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
echo "VM report uploaded successfully."
else
echo "VM report file does not exist. Skipping upload."
fi
if [ -f "$CONTAINER_REPORT" ]; then
echo "Container report file exists. Uploading to S3..."
aws s3 cp "$CONTAINER_REPORT" "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
echo "Container report uploaded successfully."
else
echo "Container report file does not exist. Skipping upload."
fi
if [ -f "$VM_SERIAL_REPORT" ]; then
echo "VM serial report file exists. Uploading to S3..."
aws s3 cp "$VM_SERIAL_REPORT" "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-serial-report.json"
echo "VM serial report uploaded successfully."
else
echo "VM serial report file does not exist. Skipping upload."
fi
32 changes: 31 additions & 1 deletion .github/workflows/e2e-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: credhelper-test
aws-region: ${{ secrets.REGION }}
aws-region: ${{ secrets.REGION }}
- name: Remove Finch VM
timeout-minutes: 2
run: ./scripts/cleanup_wsl.ps1
Expand Down Expand Up @@ -89,6 +89,36 @@ jobs:
git status
git clean -f -d
make ${{ inputs.test-command }}
- name: Check and upload e2e tests reports to s3 bucket
if: ${{ always() }}
run: |
$VM_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
$CONTAINER_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
$VM_SERIAL_REPORT="${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-serial-report.json"
if (Test-Path $VM_REPORT) {
Write-Host "VM report file exists. Uploading to S3..."
aws s3 cp $VM_REPORT "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
Write-Host "VM report uploaded successfully."
} else {
Write-Host "VM report file does not exist. Skipping upload."
}
if (Test-Path $CONTAINER_REPORT) {
Write-Host "Container report file exists. Uploading to S3..."
aws s3 cp $CONTAINER_REPORT "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
Write-Host "Container report uploaded successfully."
} else {
Write-Host "Container report file does not exist. Skipping upload."
}
if (Test-Path $VM_SERIAL_REPORT) {
Write-Host "VM serial report file exists. Uploading to S3..."
aws s3 cp $VM_SERIAL_REPORT "s3://finch-e2e-test-log-reports/${{ inputs.os }}-${{ inputs.arch }}/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-serial-report.json.json"
Write-Host "VM serial report uploaded successfully."
} else {
Write-Host "VM serial report file does not exist. Skipping upload."
}
- name: Remove Finch VM and Clean Up Previous Environment
if: ${{ always() }}
timeout-minutes: 2
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ DEST := $(shell echo "$(DESTDIR)/$(PREFIX)" | sed 's:///*:/:g; s://*$$::')
BINDIR ?= /usr/local/bin
OUTDIR ?= $(CURDIR)/_output
OS_OUTDIR ?= $(OUTDIR)/os
REPORT_DIR ?= $(CURDIR)/reports
RUN_ID ?= $(GITHUB_RUN_ID)
RUN_ATTEMPT ?= $(GITHUB_RUN_ATTEMPT)

OUTPUT_DIRECTORIES := $(OUTDIR) $(OS_OUTDIR)
$(OUTPUT_DIRECTORIES):
Expand Down Expand Up @@ -266,15 +269,15 @@ test-e2e: test-e2e-vm-serial test-e2e-container

.PHONY: test-e2e-vm-serial
test-e2e-vm-serial:
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 --installed="$(INSTALLED)"
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-serial-report.json --installed="$(INSTALLED)"

.PHONY: test-e2e-container
test-e2e-container:
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/container -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 --installed="$(INSTALLED)"
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/container -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-container-report.json --installed="$(INSTALLED)"

.PHONY: test-e2e-vm
test-e2e-vm:
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 --installed="$(INSTALLED)" --registry="$(REGISTRY)"
go test -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-report.json --installed="$(INSTALLED)" --registry="$(REGISTRY)"

.PHONY: test-benchmark
test-benchmark:
Expand Down

0 comments on commit 099c8b1

Please sign in to comment.