Skip to content

Commit

Permalink
chore: rm it image (#1152)
Browse files Browse the repository at this point in the history
* chore: try to remove IT image

* chore: rm node install where not needed

* chore: try with sudo

* chore: fix needs for API test

* rm IT action

* chore: try to fix build

* chore: try to fix run commands

* chore: try to fix run

* Set e

* chore: timeouts and sudo

* chore: try to use uuidgen instead

* Try 0.0.0.0

* Rm e

* Try to fix redis test

* always run log upload step

* try to expose redis port on host

* rm redis test
  • Loading branch information
markphelps authored Nov 22, 2022
1 parent 8a65d56 commit 80b4478
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 158 deletions.
16 changes: 0 additions & 16 deletions .github/actions/integration-test/action.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/integration-test-image.yml

This file was deleted.

109 changes: 57 additions & 52 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest

timeout-minutes: 20

steps:
Expand Down Expand Up @@ -63,8 +62,19 @@ jobs:
needs: build
name: Test API
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive

steps:
- name: Install dependencies
run: |
echo 'tzdata tzdata/Areas select Etc' | sudo debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | sudo debconf-set-selections; \
sudo apt-get update && \
sudo apt-get install -y \
tzdata bats curl wget jq gnupg uuid-runtime
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
Expand All @@ -77,12 +87,11 @@ jobs:
working-directory: bin/

- name: Run API tests
uses: ./.github/actions/integration-test
with:
script: ./test/api.sh
run: ./test/api.sh

- name: Upload the log
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: api.log
path: out.log
Expand All @@ -92,46 +101,19 @@ jobs:
needs: build
name: Test API (with authentication enabled)
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
id: download
with:
name: flipt
path: bin/

- run: chmod +x flipt
working-directory: bin/

- name: Run API tests
uses: ./.github/actions/integration-test
with:
script: ./test/api_with_auth.sh

- name: Upload the log
uses: actions/upload-artifact@v3
with:
name: api-with-auth.log
path: out.log
retention-days: 5

redis:
needs: build
name: Test Redis
runs-on: ubuntu-latest

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
- name: Install dependencies
run: |
echo 'tzdata tzdata/Areas select Etc' | sudo debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | sudo debconf-set-selections; \
sudo apt-get update && \
sudo apt-get install -y \
tzdata bats curl wget jq gnupg uuid-runtime
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
Expand All @@ -144,24 +126,33 @@ jobs:
working-directory: bin/

- name: Run API tests
uses: ./.github/actions/integration-test
with:
script: ./test/api.sh
config: "redis.yml"
run: ./test/api_with_auth.sh

- name: Upload the log
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: redis.log
name: api-with-auth.log
path: out.log
retention-days: 5

cli:
needs: build
name: Test CLI
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive

steps:
- name: Install dependencies
run: |
echo 'tzdata tzdata/Areas select Etc' | sudo debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | sudo debconf-set-selections; \
sudo apt-get update && \
sudo apt-get install -y \
tzdata bats curl wget jq gnupg uuid-runtime
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
Expand All @@ -173,16 +164,32 @@ jobs:
working-directory: bin/

- name: Run CLI tests
uses: ./.github/actions/integration-test
with:
script: ./test/cli.bats
run: ./test/cli.bats

ui:
needs: build
name: Test UI
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive

steps:
- name: Install dependencies
run: |
echo 'tzdata tzdata/Areas select Etc' | sudo debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | sudo debconf-set-selections; \
sudo apt-get update && \
sudo apt-get install -y \
tzdata bats curl wget jq gnupg uuid-runtime && \
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && \
sudo apt-get update && \
sudo apt-get install -y nodejs
- name: Install playwright
run: |
npx playwright install chromium --with-deps
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
Expand All @@ -194,6 +201,4 @@ jobs:
working-directory: bin/

- name: Run UI tests
uses: ./.github/actions/integration-test
with:
script: ./test/ui.sh
run: ./test/ui.sh
34 changes: 0 additions & 34 deletions Dockerfile.it

This file was deleted.

6 changes: 3 additions & 3 deletions test/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

cd "$(dirname "$0")/.." || exit

export SHAKEDOWN_URL="http://127.0.0.1:8080"
export SHAKEDOWN_URL="http://0.0.0.0:8080"

source ./test/helpers/shakedown/shakedown.sh

Expand All @@ -25,7 +25,7 @@ trap finish EXIT

uuid_str()
{
LC_ALL=C; cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1
uuidgen
}

authedShakedown() {
Expand Down Expand Up @@ -316,7 +316,7 @@ run()
echo -e "\e[32mStart testing $SHAKEDOWN_URL\e[0m"
echo -e "\e[32m===========================================\e[0m"

./test/helpers/wait-for-it/wait-for-it.sh "127.0.0.1:8080" -t 30
./test/helpers/wait-for-it/wait-for-it.sh "0.0.0.0:8080" -t 30

# allows api with auth to extract FLIPT_TOKEN from out log
[[ $(type -t _api_test_hook) == function ]] && _api_test_hook
Expand Down
2 changes: 1 addition & 1 deletion test/ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ run()

sleep 5

flipt_host="127.0.0.1:${port}"
flipt_host="0.0.0.0:${port}"

echo -e "\e[32m \e[0m"
echo -e "\e[32m===========================================\e[0m"
Expand Down

0 comments on commit 80b4478

Please sign in to comment.