Skip to content

Commit 44bfe50

Browse files
authored
Merge pull request #540 from pulp/create-pull-request/main/patch
Update CI files from main branch
2 parents 982a841 + c833614 commit 44bfe50

File tree

7 files changed

+42
-47
lines changed

7 files changed

+42
-47
lines changed

.ci/ansible/smash-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"pulp workers": {},
2727
"redis": {},
2828
"shell": {
29-
"transport": "docker"
29+
"transport": "local"
3030
}
3131
}
3232
}

.ci/ansible/start_container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
image: "{{ item.image }}"
4242
auto_remove: true
4343
recreate: true
44-
privileged: false
44+
privileged: true
4545
networks:
4646
- name: pulp_ci_bridge
4747
aliases: "{{ item.name }}"

.github/template_gitref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-136-ga3c43d7
1+
2021.08.26-144-g74beb16

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ jobs:
150150
run: .github/workflows/scripts/install_python_client.sh
151151
shell: bash
152152

153-
- name: Install Ruby client
154-
if: ${{ env.TEST == 'bindings' }}
155-
run: .github/workflows/scripts/install_ruby_client.sh
156-
shell: bash
157-
158153
- name: Before Script
159154

160155
run: .github/workflows/scripts/before_script.sh

.github/workflows/scripts/install.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then
2222
pip install -r doc_requirements.txt
2323
fi
2424

25-
pip install -e ../pulpcore
26-
pip install -r functest_requirements.txt
27-
2825
cd .ci/ansible/
2926

3027
TAG=ci_build
28+
PULPCORE=./pulpcore
3129
if [[ "$TEST" == "plugin-from-pypi" ]]; then
3230
PLUGIN_NAME=pulp_python
3331
elif [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then
@@ -47,6 +45,8 @@ plugins:
4745
source: pulpcore
4846
- name: pulp_python
4947
source: "${PLUGIN_NAME}"
48+
- name: pulp-smash
49+
source: ./pulp-smash
5050
VARSYAML
5151
else
5252
cat >> vars/main.yaml << VARSYAML
@@ -57,7 +57,9 @@ plugins:
5757
- name: pulp_python
5858
source: "${PLUGIN_NAME}"
5959
- name: pulpcore
60-
source: ./pulpcore
60+
source: "${PULPCORE}"
61+
- name: pulp-smash
62+
source: ./pulp-smash
6163
VARSYAML
6264
fi
6365

@@ -68,6 +70,8 @@ services:
6870
volumes:
6971
- ./settings:/etc/pulp
7072
- ./ssh:/keys/
73+
- ~/.config:/root/.config
74+
- ../../../pulp-openapi-generator:/root/pulp-openapi-generator
7175
VARSYAML
7276

7377
cat >> vars/main.yaml << VARSYAML

.github/workflows/scripts/install_python_client.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10-
set -euv
10+
set -mveuo pipefail
1111

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

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

4747
find ./docs/* -exec sed -i 's/Back to README/Back to HOME/g' {} \;

.github/workflows/scripts/script.sh

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,28 @@ if [[ "$TEST" == "plugin-from-pypi" ]]; then
6161
git checkout ${COMPONENT_VERSION} -- pulp_python/tests/
6262
fi
6363

64+
echo "machine pulp
65+
login admin
66+
password password
67+
" | cmd_stdin_prefix bash -c "cat > /root/.netrc"
68+
69+
cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"
70+
cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt"
71+
cmd_prefix pip3 install -r /tmp/unittest_requirements.txt
72+
cmd_prefix pip3 install -r /tmp/functest_requirements.txt
73+
cmd_prefix pip3 install --upgrade ../pulp-smash
74+
6475
cd ../pulp-openapi-generator
76+
./generate.sh pulp_python python
77+
cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_python-client
78+
sudo rm -rf ./pulp_python-client
6579
./generate.sh pulpcore python
66-
pip install ./pulpcore-client
67-
rm -rf ./pulpcore-client
68-
if [[ "$TEST" = 'bindings' ]]; then
69-
./generate.sh pulpcore ruby 0
70-
cd pulpcore-client
71-
gem build pulpcore_client.gemspec
72-
gem install --both ./pulpcore_client-0.gem
73-
fi
80+
cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client
81+
sudo rm -rf ./pulpcore-client
7482
cd $REPO_ROOT
7583

76-
if [[ "$TEST" = 'bindings' ]]; then
77-
if [ -f $REPO_ROOT/.ci/assets/bindings/test_bindings.py ]; then
78-
python $REPO_ROOT/.ci/assets/bindings/test_bindings.py
79-
fi
80-
if [ -f $REPO_ROOT/.ci/assets/bindings/test_bindings.rb ]; then
81-
ruby $REPO_ROOT/.ci/assets/bindings/test_bindings.rb
82-
fi
83-
exit
84-
fi
85-
86-
cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"
87-
cmd_prefix pip3 install -r /tmp/unittest_requirements.txt
84+
CERTIFI=$(cmd_prefix python3 -c 'import certifi; print(certifi.where())')
85+
cmd_prefix bash -c "cat /etc/pulp/certs/pulp_webserver.crt | tee -a "$CERTIFI" > /dev/null"
8886

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

9896
# Run functional tests
99-
export PYTHONPATH=$REPO_ROOT${PYTHONPATH:+:${PYTHONPATH}}
100-
10197
if [[ "$TEST" == "performance" ]]; then
10298
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
103-
pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_python.tests.performance
99+
cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_python.tests.performance"
104100
else
105-
pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_python.tests.performance.test_$PERFORMANCE_TEST
101+
cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_python.tests.performance.test_$PERFORMANCE_TEST"
106102
fi
107103
exit
108104
fi
@@ -112,20 +108,20 @@ if [ -f $FUNC_TEST_SCRIPT ]; then
112108
else
113109

114110
if [[ "$GITHUB_WORKFLOW" == "Python Nightly CI/CD" ]]; then
115-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m parallel -n 8
116-
pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional -m "not parallel"
111+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m parallel -n 8 --nightly"
112+
cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional -m 'not parallel' --nightly"
117113

118114

119-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and parallel" -n 8
120-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not parallel"
115+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and parallel' -n 8 --nightly"
116+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not parallel' --nightly"
121117

122118
else
123-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m "parallel and not nightly" -n 8
124-
pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional -m "not parallel and not nightly"
119+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m parallel -n 8"
120+
cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional -m 'not parallel'"
125121

126122

127-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not nightly and parallel" -n 8
128-
pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not nightly and not parallel"
123+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and parallel' -n 8"
124+
cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not parallel'"
129125

130126
fi
131127

0 commit comments

Comments
 (0)