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

Replace smoke test with a basic test against __frontend_lbheartbeat__ #13390

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 19 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,15 @@ jobs:
<<: *defaults-release
steps:
- better_checkout
- run: pip install tox
- run: TOXENV=dennis-lint tox

- run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear why this is changed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because I noticed tox was not necessary any more with the smoke tests removed, it was never super useful for the check locales step

name: Install Dennis
command: pip install dennis==1.1.0
- run:
name: Lint locales
command: |
bash -c 'dennis-cmd lint locale/*/LC_MESSAGES/*.po --rules W202'
bash -c 'dennis-cmd lint --errorsonly locale/*/LC_MESSAGES/*.po'
bash -c 'dennis-cmd lint --errorsonly locale/templates/LC_MESSAGES/*.pot'

release-blog-utils:
<<: *defaults
Expand All @@ -235,9 +241,6 @@ jobs:
- run:
name: Install dependencies
command: sudo apt-get update; sudo apt-get install pigz
- run:
name: "Install Tox"
command: pip install tox
- run: docker info
# Build the container, using Circle's Docker cache. Only use 1 image per
# day to keep the cache size down.
Expand Down Expand Up @@ -271,6 +274,11 @@ jobs:
command: |
IMG="image-$(date +%j).gz"; docker save addons-frontend | pigz --fast -c > ~/addons-frontend/docker/$IMG; ls -l ~/addons-frontend/docker
ls -l ~/addons-frontend/docker
- run:
name: Check image works
command: |
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having issues running this locally. it could be a platform issue, I'm not sure. In debugging I did find that docker supports adding a healthcheck to docker run.

--health-cmd string                Command to run to check health
      --health-interval duration         Time between running the check (ms|s|m|h) (default 0s)
      --health-retries int               Consecutive failures needed to report unhealthy
      --health-start-interval duration   Time between running the check during the start period (ms|s|m|h) (default 0s)
      --health-start-period duration     Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
      --health-timeout duration          Maximum time to allow one check to run (ms|s|m|h) (default 0s)

curl --retry-all-errors --retry 10 --retry-delay 2 http://127.0.0.1:4000/__frontend_lbheartbeat__
- run:
name: Push to repo
command: |
Expand All @@ -279,17 +287,6 @@ jobs:
docker tag addons-frontend $DOCKERHUB_REPO:$CIRCLE_TAG
docker images
docker push $DOCKERHUB_REPO:$CIRCLE_TAG
- run:
name: Set hosts
command: |
echo 127.0.0.1 olympia.test | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Test Image
command: |
sudo sysctl -w vm.max_map_count=262144
./tests/smoke/setup_docker.sh
tox -e smoke-tests

release-master: # build for the master branch
<<: *defaults-release
Expand All @@ -298,9 +295,6 @@ jobs:
- run:
name: Install dependencies
command: sudo apt-get update; sudo apt-get install pigz
- run:
name: "Install Tox"
command: pip install tox
- run: docker info
# Build the container, using Circle's Docker cache. Only use 1 image per
# day to keep the cache size down.
Expand Down Expand Up @@ -334,23 +328,17 @@ jobs:
command: |
IMG="image-$(date +%j).gz"; docker save addons-frontend | pigz --fast -c > ~/addons-frontend/docker/$IMG; ls -l ~/addons-frontend/docker
ls -l ~/addons-frontend/docker
- run:
name: Check image works
command: |
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend
curl --retry-all-errors --retry 10 --retry-delay 2 http://127.0.0.1:4000/__frontend_lbheartbeat__
- run:
name: Push to repo
command: |
[ ! -z $DOCKERHUB_REPO ]
docker tag addons-frontend $DOCKERHUB_REPO:latest
docker push $DOCKERHUB_REPO:latest
- run:
name: Set hosts
command: |
echo 127.0.0.1 olympia.test | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Test Image
command: |
sudo sysctl -w vm.max_map_count=262144
./tests/smoke/setup_docker.sh
tox -e smoke-tests

workflows:
version: 2
Expand Down
14 changes: 0 additions & 14 deletions tests/smoke/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions tests/smoke/setup_docker.sh

This file was deleted.

9 changes: 0 additions & 9 deletions tests/smoke/test_homepage.py

This file was deleted.

23 changes: 0 additions & 23 deletions tox.ini

This file was deleted.

Loading