-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to be based on pytest from now
- Loading branch information
1 parent
e7a5a59
commit 39e03a8
Showing
3 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,16 @@ jobs: | |
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt # Adjust this to your dependencies file if needed | ||
- name: Run tests with pytest | ||
run: | | ||
python -m pip install pytest | ||
pytest # Adjust this command if specific options or directories are needed | ||
- name: Extract version from release tag | ||
id: get_version | ||
run: | | ||
|
@@ -31,17 +41,6 @@ jobs: | |
sed -i "s/version=.*,/version='${{ env.version }}',/" setup.py | ||
sed -i "s/release = .*/release = '${{ env.version }}'/" docs/source/conf.py | ||
- name: Commit and push version updates | ||
env: | ||
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
git add setup.py docs/source/conf.py | ||
git commit -m "Update version to ${{ env.version }}" | ||
git push origin HEAD:master | ||
- name: Build release distributions | ||
run: | | ||
python -m pip install build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Copyright (c) 2024-2025 ROCK LAB PRIVATE LIMITED | ||
This file is part of "Stresslog" project and is released under the | ||
GNU Affero General Public License v3.0 (AGPL-3.0) | ||
See the GNU Affero General Public License for more details: <https://www.gnu.org/licenses/agpl-3.0.html> | ||
""" | ||
import pytest | ||
import stresslog as lst | ||
import pandas as pd | ||
|
||
|
||
def test_integration_basic(): | ||
# Test case 1: Basic well log generation and plotting | ||
attrib = [10, 0, 0, 0, 0, 0, 0, 0] | ||
well = lst.create_random_well(kb=35, gl=-200, step=0.15) | ||
dev = lst.getwelldev(wella=well) | ||
output = lst.plotPPzhang(dev, writeFile=False) | ||
|
||
assert output is not None, "plotPPzhang did not return an output" | ||
|
||
def test_integration_doi(): | ||
# Test case 2: Well with attributes and DOI | ||
attrib = [10, -200, 0, 0, 0, 0, 0, 0] | ||
well = lst.create_random_well(kb=312, gl=300, step=1) | ||
dev = lst.getwelldev(wella=well, kickoffpoint=3000, final_angle=90, rateofbuild=0.2, azimuth=270) | ||
output = lst.plotPPzhang(dev, attrib=attrib, doi=2625, writeFile=False) | ||
assert output is not None, "plotPPzhang with attributes and DOI did not return an output" | ||
|
||
def test_integration_advanced(): | ||
# Test case 3: Shallow angle well and custom TECB | ||
attrib = [10, -200, 0, 0, 0, 0, 0, 0] | ||
well = lst.create_random_well(kb=35, gl=-200, step=1) | ||
dev = lst.getwelldev(wella=well, kickoffpoint=300, final_angle=10, rateofbuild=0.2, azimuth=270) | ||
output = lst.plotPPzhang(dev, attrib=attrib, doi=2625, tecb=0.55, writeFile=False) | ||
|
||
assert output is not None, "plotPPzhang for shallow angle well did not return an output" | ||
|
||
print("All tests passed!") | ||
|
||
#if __name__=="__main__": | ||
# integrationTest() |
This file was deleted.
Oops, something went wrong.