Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot authored and ipanova committed Jun 20, 2022
1 parent c605de7 commit d85e9d9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .ci/ansible/smash-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"pulp workers": {},
"redis": {},
"shell": {
"transport": "docker"
"transport": "local"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion .ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
image: "{{ item.image }}"
auto_remove: true
recreate: true
privileged: false
privileged: true
networks:
- name: pulp_ci_bridge
aliases: "{{ item.name }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-139-g0d40f35
2021.08.26-141-g371316a
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ jobs:
run: .github/workflows/scripts/install_python_client.sh
shell: bash

- name: Install Ruby client
if: ${{ env.TEST == 'bindings' }}
run: .github/workflows/scripts/install_ruby_client.sh
shell: bash

- name: Before Script

run: .github/workflows/scripts/before_script.sh
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then
pip install -r doc_requirements.txt
fi

pip install -e ../pulpcore
pip install -r functest_requirements.txt

cd .ci/ansible/

TAG=ci_build
Expand All @@ -48,6 +45,8 @@ plugins:
source: pulpcore>=3.17.0,<3.20
- name: pulp_container
source: "${PLUGIN_NAME}"
- name: pulp-smash
source: ./pulp-smash
VARSYAML
else
cat >> vars/main.yaml << VARSYAML
Expand All @@ -59,6 +58,8 @@ plugins:
source: "${PLUGIN_NAME}"
- name: pulpcore
source: "${PULPCORE}"
- name: pulp-smash
source: ./pulp-smash
VARSYAML
fi

Expand All @@ -69,6 +70,8 @@ services:
volumes:
- ./settings:/etc/pulp
- ./ssh:/keys/
- ~/.config:/root/.config
- ../../../pulp-openapi-generator:/root/pulp-openapi-generator
VARSYAML

cat >> vars/main.yaml << VARSYAML
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scripts/install_python_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# For more info visit https://github.com/pulp/plugin_template

set -euv
set -mveuo pipefail

export PULP_URL="${PULP_URL:-https://pulp}"

Expand All @@ -30,7 +30,7 @@ export response=$(curl --write-out %{http_code} --silent --output /dev/null http
if [ "$response" == "200" ];
then
echo "pulp_container client $VERSION has already been released. Installing from PyPI."
pip install pulp-container-client==$VERSION
docker exec pulp pip3 install pulp-container-client==$VERSION
mkdir -p dist
tar cvf python-client.tar ./dist
exit
Expand All @@ -41,7 +41,7 @@ rm -rf pulp_container-client
./generate.sh pulp_container python $VERSION
cd pulp_container-client
python setup.py sdist bdist_wheel --python-tag py3
find . -name "*.whl" -exec pip install {} \;
find . -name "*.whl" -exec docker exec pulp pip3 install /root/pulp-openapi-generator/pulp_container-client/{} \;
tar cvf ../../pulp_container/python-client.tar ./dist

find ./docs/* -exec sed -i 's/Back to README/Back to HOME/g' {} \;
Expand Down
52 changes: 24 additions & 28 deletions .github/workflows/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,28 @@ if [[ "$TEST" == "plugin-from-pypi" ]]; then
git checkout ${COMPONENT_VERSION} -- pulp_container/tests/
fi

echo "machine pulp
login admin
password password
" | cmd_stdin_prefix bash -c "cat > /root/.netrc"

cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"
cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt"
cmd_prefix pip3 install -r /tmp/unittest_requirements.txt
cmd_prefix pip3 install -r /tmp/functest_requirements.txt
cmd_prefix pip3 install --upgrade ../pulp-smash

cd ../pulp-openapi-generator
./generate.sh pulp_container python
cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_container-client
sudo rm -rf ./pulp_container-client
./generate.sh pulpcore python
pip install ./pulpcore-client
rm -rf ./pulpcore-client
if [[ "$TEST" = 'bindings' ]]; then
./generate.sh pulpcore ruby 0
cd pulpcore-client
gem build pulpcore_client.gemspec
gem install --both ./pulpcore_client-0.gem
fi
cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client
sudo rm -rf ./pulpcore-client
cd $REPO_ROOT

if [[ "$TEST" = 'bindings' ]]; then
if [ -f $REPO_ROOT/.ci/assets/bindings/test_bindings.py ]; then
python $REPO_ROOT/.ci/assets/bindings/test_bindings.py
fi
if [ -f $REPO_ROOT/.ci/assets/bindings/test_bindings.rb ]; then
ruby $REPO_ROOT/.ci/assets/bindings/test_bindings.rb
fi
exit
fi

cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"
cmd_prefix pip3 install -r /tmp/unittest_requirements.txt
CERTIFI=$(cmd_prefix python3 -c 'import certifi; print(certifi.where())')
cmd_prefix bash -c "cat /etc/pulp/certs/pulp_webserver.crt | tee -a "$CERTIFI" > /dev/null"

# check for any uncommitted migrations
echo "Checking for uncommitted migrations..."
Expand All @@ -96,13 +94,11 @@ if [[ "$TEST" != "upgrade" ]]; then
fi

# Run functional tests
export PYTHONPATH=$REPO_ROOT${PYTHONPATH:+:${PYTHONPATH}}

if [[ "$TEST" == "performance" ]]; then
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_container.tests.performance
cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_container.tests.performance"
else
pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_container.tests.performance.test_$PERFORMANCE_TEST
cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_container.tests.performance.test_$PERFORMANCE_TEST"
fi
exit
fi
Expand All @@ -112,13 +108,13 @@ if [ -f $FUNC_TEST_SCRIPT ]; then
else

if [[ "$GITHUB_WORKFLOW" == "Container Nightly CI/CD" ]]; then
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_container.tests.functional -m parallel -n 8 --nightly
pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m "not parallel" --nightly
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_container.tests.functional -m parallel -n 8 --nightly"
cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m 'not parallel' --nightly"


else
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_container.tests.functional -m parallel -n 8
pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m "not parallel"
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_container.tests.functional -m parallel -n 8"
cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m 'not parallel'"


fi
Expand Down

0 comments on commit d85e9d9

Please sign in to comment.