tests: add functionnal tests (e2e if you will)
This commit is contained in:
parent
f3cc8bdb10
commit
9174e537b6
4 changed files with 414 additions and 1 deletions
|
|
@ -52,5 +52,37 @@ jobs:
|
|||
go-version: '1.21'
|
||||
cache: true
|
||||
|
||||
- name: Run tests
|
||||
- name: Run unit tests
|
||||
run: go test -v -race ./...
|
||||
|
||||
functional:
|
||||
runs-on: codeberg-small
|
||||
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
|
||||
needs: [build, test]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: https://github.com/actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
cache: true
|
||||
|
||||
- name: Build production binary
|
||||
run: |
|
||||
make build
|
||||
echo "Binary built at: $(pwd)/bin/fgj"
|
||||
|
||||
- name: Run functional tests
|
||||
if: vars.CODEBERG_TEST_OWNER != ''
|
||||
run: go test -v -race -tags=functional ./tests/functional/...
|
||||
env:
|
||||
CODEBERG_TEST_TOKEN: ${{ secrets.CODEBERG_TEST_TOKEN }}
|
||||
CODEBERG_TEST_OWNER: ${{ vars.CODEBERG_TEST_OWNER }}
|
||||
CODEBERG_TEST_REPO: ${{ vars.CODEBERG_TEST_REPO }}
|
||||
CODEBERG_TEST_HOSTNAME: ${{ vars.CODEBERG_TEST_HOSTNAME || 'codeberg.org' }}
|
||||
|
||||
- name: Skip functional tests
|
||||
if: vars.CODEBERG_TEST_OWNER == ''
|
||||
run: echo "Skipping functional tests - CODEBERG_TEST_OWNER not configured. See SETUP_FUNCTIONAL_TESTS.md for setup instructions."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue