diff --git a/.circleci/config.yml b/.circleci/config.yml index e64dc82cb4..890a6488ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,7 @@ jobs: python3 -m pip install --upgrade pip --quiet bin/test/test_prerequisites.sh echo "================= Tests units =================" + cargo build --verbose --locked --color always cargo test --features strict --verbose --color always mitmdump --version pip3 install lxml bs4 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 515c18937d..d2b11b1b2a 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -34,10 +34,6 @@ jobs: run: | 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: Get version run: | VERSION=$(bin/release/get_version.sh) @@ -213,10 +209,6 @@ jobs: run: | 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: Get version run: | VERSION=$(bin/release/get_version.sh) @@ -253,10 +245,6 @@ jobs: brew install pkg-config 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: Get version run: | VERSION=$(bin/release/get_version.sh) @@ -308,11 +296,9 @@ jobs: run: .\bin\environment.ps1 - name: Install prerequisites run: .\bin\install_prerequisites_windows.ps1 - - name: Build and test integ + - name: Build run: | .\bin\release\release.ps1 - .\bin\test\test_prerequisites.ps1 - .\bin\test\test_integ.ps1 - name: Create windows64 Zip package run: .\bin\release\create_windows64_zip_package.ps1 - name: Install win64 zip and test integ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0e8eeb844..942b72a66b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,7 @@ jobs: - name: Tests units run: | bin/test/test_unit.sh + bin/release/release.sh echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}" - name: Integration Tests run: bin/test/test_integ.sh @@ -101,6 +102,7 @@ jobs: - name: Tests units run: | bin/test/test_unit.sh + bin/release/release.sh echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}" - name: Integration Tests run: bin/test/test_integ.sh @@ -244,8 +246,8 @@ jobs: run: bin/test/test_prerequisites.sh - name: Tests units run: | - brew install pkg-config bin/test/test_unit.sh + bin/release/release.sh echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}" - name: Integration Tests run: bin/test/test_integ.sh diff --git a/bin/test/test.ps1 b/bin/test/test.ps1 index 1073c4b105..03b1372bed 100644 --- a/bin/test/test.ps1 +++ b/bin/test/test.ps1 @@ -7,5 +7,8 @@ powershell write-host -foregroundcolor Cyan "----- tests -----" if ($LASTEXITCODE) { Throw } & $PSScriptRoot\test_unit.ps1 if ($LASTEXITCODE) { Throw } +& $PSScriptRoot\..\release\release.ps1 +if ($LASTEXITCODE) { Throw } & $PSScriptRoot\test_integ.ps1 if ($LASTEXITCODE) { Throw } + diff --git a/bin/test/test.sh b/bin/test/test.sh index e08836d4b9..c02b749006 100755 --- a/bin/test/test.sh +++ b/bin/test/test.sh @@ -3,6 +3,8 @@ set -Eeuo pipefail "$(dirname "$0")"/test_prerequisites.sh "$(dirname "$0")"/test_unit.sh +"$(dirname "$0")"/../release/release.sh export PATH="${PWD}/target/release:$PATH" "$(dirname "$0")"/test_integ.sh + diff --git a/bin/test/test_unit.ps1 b/bin/test/test_unit.ps1 index 6c41b338bc..78151d03a8 100644 --- a/bin/test/test_unit.ps1 +++ b/bin/test/test_unit.ps1 @@ -6,25 +6,3 @@ powershell write-host -foregroundcolor Cyan "----- unit tests -----" # run test units cargo test --release --features strict --tests if ($LASTEXITCODE) { Throw } - -# create test package -$project_root_path=(Resolve-Path -LiteralPath $PSScriptRoot\..\..).path -$release_dir="$project_root_path\target\release" -$package_dir="$project_root_path\target\test-package" -New-Item -ItemType Directory -Force -Path "$package_dir" -Get-ChildItem -Path $release_dir -Recurse -Include *.dll -File | Copy-Item -Destination $package_dir -Get-ChildItem -Path $release_dir -Recurse -Include hurl*.exe -File | Copy-Item -Destination $package_dir - -# add hurl to PATH -$registry_user_path=(Get-ItemProperty -Path 'HKCU:\Environment').Path -$registry_machine_path=(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment').Path -$env:Path = "$package_dir;$registry_user_path;$registry_machine_path" -sleep 10 - -# hurl infos -(Get-Command hurl).Path -(Get-Command hurlfmt).Path -hurl --version -if ($LASTEXITCODE) { Throw } -hurlfmt --version -if ($LASTEXITCODE) { Throw } diff --git a/bin/test/test_unit.sh b/bin/test/test_unit.sh index eb3b8b48b0..5898f31406 100755 --- a/bin/test/test_unit.sh +++ b/bin/test/test_unit.sh @@ -5,9 +5,3 @@ echo "----- unit tests -----" PATH="$HOME"/.cargo/bin:$PATH export PATH cargo test --release - -# 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" - diff --git a/packages/hurl/src/http/tests/libcurl.rs b/packages/hurl/src/http/tests/libcurl.rs index f47ec38d17..d03f37102d 100644 --- a/packages/hurl/src/http/tests/libcurl.rs +++ b/packages/hurl/src/http/tests/libcurl.rs @@ -619,15 +619,11 @@ fn test_cacert() { assert_eq!( certificate.issuer, - "C=US, ST=Denial, L=Springfield, O=Dis, CN=localhost" - .to_string() - .to_string() + "C=US, ST=Denial, L=Springfield, O=Dis, CN=localhost".to_string() ); assert_eq!( certificate.subject, - "C=US, ST=Denial, L=Springfield, O=Dis, CN=localhost" - .to_string() - .to_string() + "C=US, ST=Denial, L=Springfield, O=Dis, CN=localhost".to_string() ); assert_eq!( certificate.start_date,