Compare commits

...

19 Commits

Author SHA1 Message Date
Kyle Altendorf f1e4670a6a
Merge branch 'main' into explore_test_installed_code_not_source 2023-06-29 18:15:42 -04:00
Kyle Altendorf 4c748a0e4d
whitespace 2023-06-29 18:15:35 -04:00
Kyle Altendorf 659c7f8609
Update .coveragerc 2023-06-15 14:03:48 -04:00
Kyle Altendorf 497fbd4e20
Update test-single.yml 2023-06-15 14:00:59 -04:00
Kyle Altendorf 69037310a1
more 2023-06-15 12:27:31 -04:00
Kyle Altendorf e99c696d43
, 2023-06-15 12:26:34 -04:00
Kyle Altendorf 3127898f46
also Install.ps1 2023-06-15 12:22:21 -04:00
Kyle Altendorf 7196e92200
Merge branch 'test_single_bash' into explore_test_installed_code_not_source 2023-06-15 12:14:37 -04:00
Kyle Altendorf e6f79fca10
Update test-single.yml 2023-06-15 12:08:29 -04:00
Kyle Altendorf a0f4579692
Update test-single.yml 2023-06-15 12:05:09 -04:00
Kyle Altendorf 3fa9b9f2d1
Update test-single.yml 2023-06-15 11:58:24 -04:00
Kyle Altendorf f2130db777
env.GITHUB_WORKSPACE 2023-06-15 11:52:59 -04:00
Kyle Altendorf ed21e93a2a
try removing windows specific steps 2023-06-15 11:44:45 -04:00
Kyle Altendorf 58947e19a0
test-single.yml: defaults: run: shell: bash 2023-06-15 11:40:41 -04:00
Kyle Altendorf 4d72c4f575
bash it up 2023-06-15 11:39:36 -04:00
Kyle Altendorf 4bf4e6f3b2
yup 2023-06-15 11:31:18 -04:00
Kyle Altendorf 152e9a1a6b
hmm 2023-06-15 11:28:02 -04:00
Kyle Altendorf f1e1a4f236
non-editable install 2023-06-15 11:17:18 -04:00
Kyle Altendorf 3d2d3f550d
explore testing installed code, not source 2023-06-15 10:46:21 -04:00
5 changed files with 48 additions and 24 deletions

View File

@ -9,6 +9,11 @@ omit=
concurrency=multiprocessing, thread
parallel=True
[paths]
source =
chia/
venv/**/site-packages/chia/
[report]
precision = 1
exclude_lines =

View File

@ -11,6 +11,10 @@ inputs:
description: "Install development dependencies."
required: false
default: ""
editable:
description: "Install as editable source."
required: false
default: "true"
legacy_keyring:
description: "Install legacy keyring dependencies."
required: false
@ -33,7 +37,7 @@ runs:
env:
INSTALL_PYTHON_VERSION: ${{ inputs.python-version }}
run: |
${{ inputs.command-prefix }} sh install.sh ${{ inputs.development && '-d' || '' }} ${{ inputs.legacy_keyring && '-l' || '' }} ${{ inputs.automated == 'true' && '-a' || '' }}
${{ inputs.command-prefix }} sh install.sh ${{ inputs.development && '-d' || '' }} ${{ (inputs.editable != 'true') && '-i' || '' }} ${{ inputs.legacy_keyring && '-l' || '' }} ${{ inputs.automated == 'true' && '-a' || '' }}
- name: Run install script (Windows)
if: runner.os == 'windows'
@ -41,4 +45,4 @@ runs:
env:
INSTALL_PYTHON_VERSION: ${{ inputs.python-version }}
run: |
${{ inputs.command-prefix }} ./Install.ps1 ${{ inputs.development && '-d' || '' }}
${{ inputs.command-prefix }} ./Install.ps1 ${{ inputs.development && '-d' || '' }} ${{ (inputs.editable != 'true') && '-i' || '' }}

View File

@ -39,6 +39,10 @@ concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ inputs.concurrency_name }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
test:
name: ${{ matrix.os.emoji }} ${{ matrix.configuration.name }} - ${{ matrix.python.name }}
@ -192,24 +196,14 @@ jobs:
${{ github.workspace }}/.chia/test-plots
key: ${{ env.BLOCKS_AND_PLOTS_VERSION }}
- name: Checkout test blocks and plots (macOS, Ubuntu)
if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (matrix.os.matrix == 'ubuntu' || matrix.os.matrix == 'macos')
- name: Checkout test blocks and plots
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download -R Chia-Network/test-cache 0.29.0 --archive=tar.gz -O - | tar xzf -
mkdir ${{ github.workspace }}/.chia
mv ${{ github.workspace }}/test-cache-${{ env.BLOCKS_AND_PLOTS_VERSION }}/* ${{ github.workspace }}/.chia
- name: Checkout test blocks and plots (Windows)
if: steps.test-blocks-plots.outputs.cache-hit != 'true' && matrix.os.matrix == 'windows'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download -R Chia-Network/test-cache ${{ env.BLOCKS_AND_PLOTS_VERSION }} --archive=zip -O blocks_and_plots.zip
Expand-Archive blocks_and_plots.zip -DestinationPath .
mkdir ${{ github.workspace }}/.chia
mv ${{ github.workspace }}/test-cache-${{ env.BLOCKS_AND_PLOTS_VERSION }}/* ${{ github.workspace }}/.chia
mkdir "${GITHUB_WORKSPACE}/.chia"
mv "${GITHUB_WORKSPACE}/test-cache-${{ env.BLOCKS_AND_PLOTS_VERSION }}/"* "${GITHUB_WORKSPACE}/.chia"
- name: Install boost (macOS)
if: matrix.os.matrix == 'macos'
@ -220,6 +214,7 @@ jobs:
with:
python-version: ${{ matrix.python.install_sh }}
development: true
editable: false
legacy_keyring: ${{ matrix.configuration.legacy_keyring_required }}
- uses: chia-network/actions/activate-venv@main
@ -230,12 +225,20 @@ jobs:
sh install-timelord.sh -n
./vdf_bench square_asm 400000
- name: Move chia/ so we test the installed code
run: |
mv chia/ notchia/
- name: Test blockchain code with pytest
env:
ENABLE_PYTEST_MONITOR: ${{ matrix.os.matrix == 'ubuntu' && matrix.configuration.enable_pytest_monitor || '' }}
run: |
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
- name: Move back to chia/ for coverage
run: |
mv notchia/ chia/
- name: Process coverage data
run: |
coverage xml --rcfile=.coveragerc -o coverage.xml

View File

@ -2,6 +2,8 @@ param(
[Parameter(HelpMessage="install development dependencies")]
[switch]$d = $False,
[Parameter()]
[switch]$i = $False,
[Parameter()]
[switch]$p = $False
)
@ -13,6 +15,12 @@ if ($d)
$extras += "dev"
}
$editable_cli = "--editable"
if ($i)
{
$editable_cli = ""
}
if ([Environment]::Is64BitOperatingSystem -eq $false)
{
Write-Output "Chia requires a 64-bit Windows installation"
@ -106,7 +114,7 @@ py -$pythonVersion -m venv venv
venv\scripts\python -m pip install --upgrade pip setuptools wheel
venv\scripts\pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc==2.2.2
venv\scripts\pip install --editable ".$extras_cli" --extra-index-url https://pypi.chia.net/simple/
venv\scripts\pip install $editable_cli ".$extras_cli" --extra-index-url https://pypi.chia.net/simple/
if ($p)
{

View File

@ -3,13 +3,14 @@
set -o errexit
USAGE_TEXT="\
Usage: $0 [-adlsph]
Usage: $0 [-adilpsh]
-a automated install, no questions
-d install development dependencies
-i install non-editable
-l install legacy keyring dependencies (linux only)
-s skip python package installation and just do pip install
-p additional plotters installation
-s skip python package installation and just do pip install
-h display this help and exit
"
@ -21,19 +22,22 @@ PACMAN_AUTOMATED=
EXTRAS=
SKIP_PACKAGE_INSTALL=
PLOTTER_INSTALL=
EDITABLE='-e'
while getopts adlsph flag
while getopts adilpsh flag
do
case "${flag}" in
# automated
a) PACMAN_AUTOMATED=--noconfirm;;
# development
d) EXTRAS=${EXTRAS}dev,;;
# simple install
s) SKIP_PACKAGE_INSTALL=1;;
p) PLOTTER_INSTALL=1;;
# non-editable
i) EDITABLE='';;
# legacy keyring
l) EXTRAS=${EXTRAS}legacy_keyring,;;
p) PLOTTER_INSTALL=1;;
# simple install
s) SKIP_PACKAGE_INSTALL=1;;
h) usage; exit 0;;
*) echo; usage; exit 1;;
esac
@ -342,7 +346,7 @@ python -m pip install wheel
#if [ "$INSTALL_PYTHON_VERSION" = "3.8" ]; then
# This remains in case there is a diversion of binary wheels
python -m pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc==2.2.2
python -m pip install -e ."${EXTRAS}" --extra-index-url https://pypi.chia.net/simple/
python -m pip install ${EDITABLE} ."${EXTRAS}" --extra-index-url https://pypi.chia.net/simple/
if [ -n "$PLOTTER_INSTALL" ]; then
set +e