Skip to content
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

Readme #74

Merged
merged 27 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4f1835c
[lib-common] add extract_string
shizunge Nov 17, 2024
eda12b0
[gantry] small refactor _report_services. Change local var name to av…
shizunge Nov 18, 2024
842f83f
[tests] Add test_common_no_new_env. Print the loading lib message whe…
shizunge Nov 19, 2024
a8daa32
[docs] Update Authentication, refine GANTRY_MANIFEST_CMD.
shizunge Nov 20, 2024
c9ef9e9
[gantry][tests] Add --with-registry-auth for more cases. Add gantry_l…
shizunge Nov 20, 2024
55ec291
[tests] add start_multiple_replicated_services and stop_multiple_serv…
shizunge Nov 20, 2024
466857d
[tests] add coverage tag
shizunge Nov 20, 2024
67301ee
[tests] add --update-monitor=1s to GANTRY_UPDATE_OPTIONS to reduce te…
shizunge Nov 20, 2024
c8b9618
[lib-common] Allow to use pre-run and post-run commands to change the…
shizunge Nov 20, 2024
64ee7d6
[gantry][tests] cleanup, add time saving options when creating the se…
shizunge Nov 20, 2024
af6f475
[tests] create gantry_jobs.spec.sh, improve setup time of tests.
shizunge Nov 21, 2024
d891952
[tests] add get_test_service_name and _correct_service_name
shizunge Nov 21, 2024
6d0c63a
[docker] fix docker hub rate reporting when rate is -1.
shizunge Nov 22, 2024
93e1501
[gantry] make sure that image remover service name is shorter than 64.
shizunge Nov 22, 2024
0846d20
[lib-common] calculate time elapsed more than a day.
shizunge Nov 22, 2024
2d36b36
[gantry][tests] fix flaky tests running in parallel.
shizunge Nov 22, 2024
df29dc5
[tests] use docker run to start registries
shizunge Nov 22, 2024
291d0a5
[tests] create services for tests using the alpine image.
shizunge Nov 22, 2024
1ed4bc1
[gantry] follow the image remover's log and eval_cmd stdout.
shizunge Nov 22, 2024
b0ff072
[lib-common] increase docker log speed.
shizunge Nov 24, 2024
a0d96e4
[tests] allow more tests to run with a container.
shizunge Nov 25, 2024
4fb8d71
[docs] add a note about label on services. remove unnecessary comment…
shizunge Nov 28, 2024
4a4d7c2
[gantry] change some log level from debug to info.
shizunge Nov 28, 2024
bc661f1
[tests] build a local gantry image to run container tests. Also used …
shizunge Nov 28, 2024
ab3bc9c
[gantry] return non-zero when pre-run post-run failed. skip updating …
shizunge Nov 28, 2024
a08caa0
[gantry][tests] Handler warning better from docker command. Do not us…
shizunge Nov 29, 2024
d1a0d1f
[docs][tests] clarify documents about authentication and filter. Test…
shizunge Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
uses: actions/checkout@v4
- name: Generate tests coverage reports
run: |
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
bash shellspec --kcov
bash shellspec --kcov --jobs 50
- name: Upload reports
uses: actions/upload-artifact@v4
with:
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e

tests:
name: Run tests
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -37,6 +37,8 @@ jobs:
- gantry_cleanup_images_spec.sh
- gantry_common_options_spec.sh
- gantry_filters_spec.sh
- gantry_jobs_spec.sh
- gantry_login_docker_config_spec.sh
- gantry_login_negative_spec.sh
- gantry_login_spec.sh
- gantry_manifest_spec.sh
Expand Down Expand Up @@ -64,3 +66,26 @@ jobs:
run: |
bash shellspec --pattern tests/${{ matrix.test_suit }}

test_container:
name: Test container
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Install shellspec
run: |
mkdir -p ~/shellspec
cd ~/shellspec
git clone https://github.com/shellspec/shellspec.git
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec
echo -n "shellspec version: "
shellspec --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Run container tests
run: |
export GANTRY_TEST_CONTAINER=true
export GANTRY_TEST_CONTAINER_REPO_TAG=
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}"
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}"
bash shellspec --jobs 50
82 changes: 30 additions & 52 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e

tests:
name: Test script
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -40,6 +40,8 @@ jobs:
- gantry_cleanup_images_spec.sh
- gantry_common_options_spec.sh
- gantry_filters_spec.sh
- gantry_jobs_spec.sh
- gantry_login_docker_config_spec.sh
- gantry_login_negative_spec.sh
- gantry_login_spec.sh
- gantry_manifest_spec.sh
Expand All @@ -65,17 +67,40 @@ jobs:
uses: actions/checkout@v4
- name: Run tests
run: |
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
bash shellspec --pattern tests/${{ matrix.test_suit }}

test_container:
name: Test container
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Install shellspec
run: |
mkdir -p ~/shellspec
cd ~/shellspec
git clone https://github.com/shellspec/shellspec.git
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec
echo -n "shellspec version: "
shellspec --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Run container tests
run: |
export GANTRY_TEST_CONTAINER=true
export GANTRY_TEST_CONTAINER_REPO_TAG=
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}"
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}"
bash shellspec --jobs 50

build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
needs:
- shellcheck
- tests
- test_scripts
- test_container
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -114,50 +139,3 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
- name: Extract tag
run: |
TAGS="${{ steps.meta.outputs.tags }}"
for TAG in ${TAGS}; do
if echo "${TAG}" | grep -q "ghcr.io/${{ github.repository }}-development:dev-"; then
echo "TAG=${TAG}"
echo "${TAG}" > tag.txt
break;
fi
done
- name: Store tag
uses: actions/upload-artifact@v4
with:
name: tag
path: tag.txt


container_tests:
name: Test container
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
needs:
- build_and_push
steps:
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Install shellspec
run: |
mkdir -p ~/shellspec
cd ~/shellspec
git clone https://github.com/shellspec/shellspec.git
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec
echo -n "shellspec version: "
shellspec --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Load tag
uses: actions/download-artifact@v4
with:
name: tag
- name: Run tests
run: |
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
export GANTRY_TEST_CONTAINER_REPO_TAG=$(cat tag.txt)
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}"
bash shellspec --jobs 50 --tag "container_test:true"
33 changes: 28 additions & 5 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e

tests:
name: Run tests
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand All @@ -42,16 +42,39 @@ jobs:
uses: actions/checkout@v4
- name: Run tests
run: |
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
bash shellspec --jobs 50

test_container:
name: Test container
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Install shellspec
run: |
mkdir -p ~/shellspec
cd ~/shellspec
git clone https://github.com/shellspec/shellspec.git
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec
echo -n "shellspec version: "
shellspec --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Run container tests
run: |
export GANTRY_TEST_CONTAINER=true
export GANTRY_TEST_CONTAINER_REPO_TAG=
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}"
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}"
bash shellspec --jobs 50

build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
needs:
- shellcheck
- tests
- test_scripts
- test_container
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.shellspec-quick.log
coverage
gantry-test-tmp
Loading
Loading