Run test integ on deb package

This commit is contained in:
lepapareil 2022-10-04 15:31:38 +02:00
parent ecbab75b5d
commit df705c8670
No known key found for this signature in database
GPG Key ID: F4F06B068FB00692
11 changed files with 162 additions and 80 deletions

View File

@ -16,14 +16,17 @@ jobs:
bin/install_prerequisites_ubuntu.sh bin/install_prerequisites_ubuntu.sh
bin/install_rust_latest.sh bin/install_rust_latest.sh
- name: set Version - name: set Version
run: bin/release/version.sh run: |
VERSION=$(bin/release/version.sh)
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
- name: Build - name: Build
run: | run: |
bin/release/man.sh bin/release/man.sh
bin/release/release.sh bin/release/release.sh
echo "PATH=:${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Create generic linux package - name: Create generic linux package
run: bin/release/create_tarball.sh linux run: bin/release/create_tarball.sh linux
- name: Archive production artifacts (tarball) - name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: release-generic-linux-x64-artifacts name: release-generic-linux-x64-artifacts
@ -34,19 +37,46 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Curl 7.68
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://azure.archive.ubuntu.com/ubuntu/ focal main restricted
repo-name: focal
install: curl
- name: Install - name: Install
run: | run: |
bin/install_prerequisites_ubuntu.sh bin/install_prerequisites_ubuntu.sh
bin/install_rust_latest.sh bin/install_rust_latest.sh
- name: set Version - name: Environment
run: bin/release/version.sh run: bin/environment.sh
- name: Set Version
run: |
VERSION=$(bin/release/version.sh)
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
- name: Build - name: Build
run: | run: |
bin/release/man.sh bin/release/man.sh
bin/release/release.sh bin/release/release.sh
echo "PATH=:${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Test integ
run: |
bin/test/test_prerequisites.sh
bin/test/test_integ.sh
- name: Create deb package - name: Create deb package
run: bin/release/deb.sh run: bin/release/create_deb_package.sh
- name: Archive production artifacts (tarball) - name: Install package
run: |
bin/release/install_deb_package.sh
echo "PATH=/tmp/hurl-deb-package/usr/bin:$PATH" >> "${GITHUB_ENV}"
- name: Test integ
run: |
bin/test/test_prerequisites.sh
bin/test/test_integ.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: release-deb-x64-artifacts name: release-deb-x64-artifacts
@ -59,8 +89,10 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install Rust - name: Install Rust
run: bin/install_rust_latest.sh run: bin/install_rust_latest.sh
- name: set Version - name: Set Version
run: bin/release/version.sh run: |
VERSION=$(bin/release/version.sh)
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
- name: Build - name: Build
run: | run: |
bin/release/man.sh bin/release/man.sh
@ -107,15 +139,15 @@ jobs:
run: .\bin\release\create_windows64_zip_package.ps1 run: .\bin\release\create_windows64_zip_package.ps1
- name: Install win64 zip and test integ - name: Install win64 zip and test integ
run: | run: |
.\bin\test\test_prerequisites.ps1
.\bin\release\install_windows64_zip_package.ps1 .\bin\release\install_windows64_zip_package.ps1
.\bin\test\test_prerequisites.ps1
.\bin\test\test_integ.ps1 .\bin\test\test_integ.ps1
- name: Create windows64 installer - name: Create windows64 installer
run: .\bin\release\create_windows64_installer.ps1 run: .\bin\release\create_windows64_installer.ps1
- name: Install win64 installer and test integ - name: Install win64 installer and test integ
run: | run: |
.\bin\test\test_prerequisites.ps1
.\bin\release\install_windows64_installer.ps1 .\bin\release\install_windows64_installer.ps1
.\bin\test\test_prerequisites.ps1
.\bin\test\test_integ.ps1 .\bin\test\test_integ.ps1
- name: Archive production artifacts - name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -18,8 +18,10 @@ jobs:
- name: Install Rust - name: Install Rust
run: bin/install_rust_latest.sh run: bin/install_rust_latest.sh
- name: Build - name: Build
run: bin/release/release.sh run: |
- name: Run Bench Suite bin/release/release.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Bench Suite
run: bin/test/bench.sh run: bin/test/bench.sh
- name: Archive artifacts - name: Archive artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -45,9 +47,11 @@ jobs:
run: bin/install_rust_latest.sh run: bin/install_rust_latest.sh
- name: Test Prerequisites - name: Test Prerequisites
run: bin/test/test_prerequisites.sh run: bin/test/test_prerequisites.sh
- name: Run Tests units - name: Tests units
run: bin/test/test_unit.sh run: |
- name: Run Integration Tests bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh run: bin/test/test_integ.sh
- name: Archive production artifacts - name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -86,9 +90,11 @@ jobs:
run: bin/install_rust_latest.sh run: bin/install_rust_latest.sh
- name: Test Prerequisites - name: Test Prerequisites
run: bin/test/test_prerequisites.sh run: bin/test/test_prerequisites.sh
- name: Run Tests units - name: Tests units
run: bin/test/test_unit.sh run: |
- name: Run Integration Tests bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh run: bin/test/test_integ.sh
- name: Archive production artifacts - name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -190,9 +196,11 @@ jobs:
run: bin/install_rust_latest.sh run: bin/install_rust_latest.sh
- name: Test Prerequisites - name: Test Prerequisites
run: bin/test/test_prerequisites.sh run: bin/test/test_prerequisites.sh
- name: Run Tests units - name: Tests units
run: bin/test/test_unit.sh run: |
- name: Run Integration Tests bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh run: bin/test/test_integ.sh
- name: Archive production artifacts - name: Archive production artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -3,5 +3,3 @@ set -e
set -x set -x
time hurl tests/hello_1000.hurl time hurl tests/hello_1000.hurl

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
echo "----- install deb package -----"
# install
package_dir="$(cd target/upload ; pwd)"
deb_package=$(ls "${package_dir}"/hurl_*_amd64.deb)
install_dir="/tmp/hurl-deb-package"
mkdir -p "${install_dir}"
dpkg -x "${deb_package}" "${install_dir}"
# Return PATH var to parent shell
package_dir="${install_dir}/usr/bin"
echo "Run this if you want to use fresh builded hurl package:"
echo " export PATH=$package_dir:$PATH"

View File

@ -5,5 +5,7 @@ PATH="$HOME"/.cargo/bin:$PATH
export PATH export PATH
cargo build --release --verbose --locked cargo build --release --verbose --locked
target/release/hurl --version # Return PATH var to parent shell
package_dir="$(cd target/release ; pwd)"
echo "Run this if you want to use fresh builded hurl package:"
echo " export PATH=$package_dir:$PATH"

View File

@ -1,3 +1,6 @@
#!/bin/sh #!/bin/sh
set -eu set -e
echo VERSION="$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"')" >> "$GITHUB_ENV"
# Get hurl source version
VERSION="$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"')"
echo "${VERSION}"

View File

@ -1,8 +1,18 @@
#!/bin/sh #!/bin/sh
export PATH="$PWD/target/release:$PATH" set -eu
echo "----- Bench suite -----"
# hurl infos
command -v hurl
command -v hurlfmt
hurl --version
hurlfmt --version
# bench
pip3 install --requirement bin/requirements-frozen.txt pip3 install --requirement bin/requirements-frozen.txt
cd bench || exit 1 cd bench
python3 server.py >server.log 2>&1 & python3 server.py >server.log 2>&1 &
sleep 2 sleep 5
netstat -an | grep 8000 netstat -anpe | grep 8000
./run.sh ./run.sh

View File

@ -3,4 +3,5 @@ set -e
"$(dirname "$0")"/test_prerequisites.sh "$(dirname "$0")"/test_prerequisites.sh
"$(dirname "$0")"/test_unit.sh "$(dirname "$0")"/test_unit.sh
export PATH="${PWD}/target/release:$PATH"
"$(dirname "$0")"/test_integ.sh "$(dirname "$0")"/test_integ.sh

View File

@ -2,7 +2,14 @@
set -e set -e
echo "----- integration tests -----" echo "----- integration tests -----"
export PATH="$PWD/target/release:$PATH"
# hurl infos
command -v hurl
command -v hurlfmt
hurl --version
hurlfmt --version
# integration tests
cd integration || exit cd integration || exit
./integration.py ./integration.py
./test_curl_commands.sh "$(find ./tests_ok ./tests_failed -maxdepth 1 -type f -name '*.curl' ! -name '*windows*')" ./test_curl_commands.sh "$(find ./tests_ok ./tests_failed -maxdepth 1 -type f -name '*.curl' ! -name '*windows*')"

View File

@ -4,3 +4,8 @@ echo "----- unit tests -----"
PATH="$HOME"/.cargo/bin:$PATH PATH="$HOME"/.cargo/bin:$PATH
export PATH export PATH
cargo test --release --features strict --tests cargo test --release --features strict --tests
# Return PATH var to parent shell
package_dir="$(cd target/release ; pwd)"
echo "Run this if you want to use fresh builded hurl package:"
echo " export PATH=$package_dir:$PATH"