Extract e2e test environment variables into file.
This commit is contained in:

committed by
Sebastian Serth

parent
fa04ed8ad4
commit
f16efa65b7
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@ -125,16 +125,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ compile, test ]
|
||||
env:
|
||||
POSEIDON_AWS_ENABLED: false
|
||||
POSEIDON_AWS_ENDPOINT: ${{ secrets.POSEIDON_AWS_ENDPOINT }}
|
||||
POSEIDON_AWS_FUNCTIONS: ""
|
||||
POSEIDON_LOGGER_FORMATTER: "JSONFormatter"
|
||||
POSEIDON_LOG_FILE: "../../poseidon.log"
|
||||
POSEIDON_NOMAD_DISABLEFORCEPULL: true
|
||||
GOCOVERDIR: coverage
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Write secrets to environment file
|
||||
run: cat ./.github/workflows/resources/.env | envsubst > ./.env
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@ -203,6 +199,7 @@ jobs:
|
||||
run: make e2e-test-docker-image
|
||||
- name: Run e2e tests
|
||||
run: |
|
||||
export $(cat ./.env | xargs)
|
||||
sudo ./nomad agent -dev -log-level=WARN -config e2e-config.hcl &
|
||||
until curl -s --fail http://localhost:4646/v1/agent/health ; do sleep 1; done
|
||||
chmod +x ./poseidon
|
||||
@ -210,16 +207,15 @@ jobs:
|
||||
./poseidon | tee poseidon.log &
|
||||
until curl -s --fail http://localhost:7200/api/v1/health ; do sleep 1; done
|
||||
make e2e-test
|
||||
- name: Write Environment Variables to file
|
||||
run: |
|
||||
echo "${{ vars }}"
|
||||
if: ${{ success() || failure() }}
|
||||
- name: Setup Poseidon Socket
|
||||
run: |
|
||||
export $(cat ./.env | xargs)
|
||||
killall poseidon
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp ./.github/workflows/resources/poseidon-minimal.socket ~/.config/systemd/user/poseidon.socket
|
||||
cat ./.github/workflows/resources/poseidon-minimal.service | envsubst > ~/.config/systemd/user/poseidon.service
|
||||
echo "POSEIDON_SERVER_SYSTEMDSOCKETACTIVATION=TRUE" >> ./.env
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user start poseidon.socket
|
||||
if: ${{ success() || failure() }}
|
||||
@ -235,9 +231,7 @@ jobs:
|
||||
journalctl --user -xe -u poseidon.service --no-pager
|
||||
if: failure()
|
||||
- name: Stop Poseidon to flush the coverage file
|
||||
run: |
|
||||
systemctl --user stop poseidon.service poseidon.socket
|
||||
ls -lah ${GOCOVERDIR}
|
||||
run: systemctl --user stop poseidon.service poseidon.socket
|
||||
if: ${{ success() || failure() }}
|
||||
- name: Convert coverage reports
|
||||
run: make convert-run-coverage
|
||||
|
7
.github/workflows/resources/.env
vendored
Normal file
7
.github/workflows/resources/.env
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
POSEIDON_AWS_ENABLED="false"
|
||||
POSEIDON_AWS_ENDPOINT="${POSEIDON_AWS_ENDPOINT}"
|
||||
POSEIDON_AWS_FUNCTIONS=""
|
||||
POSEIDON_LOGGER_FORMATTER="JSONFormatter"
|
||||
POSEIDON_LOG_FILE="${GITHUB_WORKSPACE}/poseidon.log"
|
||||
POSEIDON_NOMAD_DISABLEFORCEPULL="true"
|
||||
GOCOVERDIR="${GITHUB_WORKSPACE}/coverage"
|
@ -8,8 +8,7 @@ Requires=poseidon.socket
|
||||
[Service]
|
||||
WorkingDirectory=${GITHUB_WORKSPACE}
|
||||
ExecStart=${GITHUB_WORKSPACE}/poseidon
|
||||
Environment="POSEIDON_SERVER_SYSTEMDSOCKETACTIVATION=TRUE"
|
||||
Environment="GOCOVERDIR=${GITHUB_WORKSPACE}/${GOCOVERDIR}"
|
||||
EnvironmentFile=${GITHUB_WORKSPACE}/.env
|
||||
|
||||
Restart=always
|
||||
StartLimitBurst=0
|
||||
|
Reference in New Issue
Block a user