-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* failing test cases errors resolved * Pytest version updated * Comments Resolved * Workflow changes * Workflow changes * coveragerc file added * New testcases added * New testcases added * Renamed all test data files to data.json || Vendor payments test resolved * Coverage 90% * APPId added to yml file | Comments resolved | gitignore updated * email pass added to yml file * Readme updated * Readme updated * Coverage table updated --------- Co-authored-by: Rushikesh Tayade <[email protected]>
- Loading branch information
Showing
50 changed files
with
1,105 additions
and
50 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
source = netsuitesdk/ | ||
omit = ./venv/*, tests/*, netsuitesdk/api/billing_account.py, netsuitesdk/api/credit_memos.py, netsuitesdk/api/custom_lists.py, netsuitesdk/api/vendor_credits.py, netsuitesdk/api/usage.py, netsuitesdk/api/invoices.py, netsuitesdk/api/terms.py, netsuitesdk/api/custom_segments.py |
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,39 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
types: [assigned, opened, synchronize, reopened] | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
environment: CI Environment | ||
steps: | ||
- uses: actions/checkout@v2 | ||
continue-on-error: true | ||
- name: Run Tests | ||
env: | ||
NS_ACCOUNT: ${{ secrets.NS_ACCOUNT }} | ||
NS_CONSUMER_KEY: ${{ secrets.NS_CONSUMER_KEY }} | ||
NS_CONSUMER_SECRET: ${{ secrets.NS_CONSUMER_SECRET }} | ||
NS_TOKEN_KEY: ${{ secrets.NS_TOKEN_KEY }} | ||
NS_TOKEN_SECRET: ${{ secrets.NS_TOKEN_SECRET }} | ||
NS_APPID: ${{ secrets.NS_APPID }} | ||
NS_EMAIL: ${{ secrets.NS_EMAIL }} | ||
NS_PASSWORD: ${{ secrets.NS_PASSWORD }} | ||
run: | | ||
pip install -r requirements.txt && pip install pytest pytest-coverage | ||
python -m pytest test/ --cov --junit-xml=test-reports/report.xml --cov-report=term-missing --cov-fail-under=85 | tee pytest-coverage.txt | ||
echo "STATUS=$(cat pytest-coverage.txt | grep 'Required test' | awk '{ print $1 }')" >> $GITHUB_ENV | ||
echo "${{ env.STATUS }}" | ||
echo "FAILED=$(cat test-reports/report.xml | awk -F'=' '{print $5}' | awk -F' ' '{gsub(/"/, "", $1); print $1}')" >> $GITHUB_ENV | ||
- name: Pytest coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
if: ${{ always() && github.ref != 'refs/heads/master' }} | ||
with: | ||
create-new-comment: true | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./test-reports/report.xml | ||
- name: Evaluate Coverage | ||
if: ${{ (env.STATUS == 'FAIL') || (env.FAILED > 0) }} | ||
run: exit 1 |
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
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 |
---|---|---|
|
@@ -228,6 +228,14 @@ export NS_TOKEN_KEY=xxxx | |
export NS_TOKEN_SECRET=xxxx | ||
python -m pytest test/integration | ||
``` | ||
Currently the code coverage is at 90% | ||
|
||
To run integration tests on a newly added / modified file | ||
|
||
```python | ||
python -m pytest -vv test/integration/test_filename.py; | ||
|
||
``` | ||
|
||
## Code coverage | ||
|
@@ -238,16 +246,44 @@ To get code coverage report, run this command: | |
python -m pytest --cov=netsuitesdk | ||
|
||
<snipped output> | ||
Name Stmts Miss Cover | ||
--------------------------------------------------- | ||
netsuitesdk/__init__.py 5 0 100% | ||
netsuitesdk/client.py 343 198 42% | ||
netsuitesdk/constants.py 3 0 100% | ||
netsuitesdk/exceptions.py 14 5 64% | ||
netsuitesdk/netsuite_types.py 2 0 100% | ||
netsuitesdk/utils.py 47 19 60% | ||
--------------------------------------------------- | ||
TOTAL 414 222 46% | ||
Name Stmts Miss Cover | ||
---------------------------------------------------------------------------- | ||
netsuitesdk/__init__.py 4 0 100% | ||
netsuitesdk/api/__init__.py 0 0 100% | ||
netsuitesdk/api/accounts.py 6 0 100% | ||
netsuitesdk/api/adv_inter_company_journal_entries.py 7 0 100% | ||
netsuitesdk/api/base.py 90 9 90% | ||
netsuitesdk/api/classifications.py 6 0 100% | ||
netsuitesdk/api/currencies.py 10 0 100% | ||
netsuitesdk/api/custom_record_types.py 11 0 100% | ||
netsuitesdk/api/custom_records.py 17 0 100% | ||
netsuitesdk/api/customers.py 21 0 100% | ||
netsuitesdk/api/departments.py 6 0 100% | ||
netsuitesdk/api/employees.py 34 0 100% | ||
netsuitesdk/api/expense_categories.py 6 0 100% | ||
netsuitesdk/api/expense_reports.py 58 2 97% | ||
netsuitesdk/api/files.py 23 0 100% | ||
netsuitesdk/api/folders.py 17 0 100% | ||
netsuitesdk/api/journal_entries.py 41 0 100% | ||
netsuitesdk/api/locations.py 6 0 100% | ||
netsuitesdk/api/price_level.py 6 0 100% | ||
netsuitesdk/api/projects.py 6 0 100% | ||
netsuitesdk/api/subsidiaries.py 6 0 100% | ||
netsuitesdk/api/tax_groups.py 6 0 100% | ||
netsuitesdk/api/tax_items.py 6 0 100% | ||
netsuitesdk/api/vendor_bills.py 55 1 98% | ||
netsuitesdk/api/vendor_payments.py 46 1 98% | ||
netsuitesdk/api/vendors.py 21 0 100% | ||
netsuitesdk/connection.py 68 0 100% | ||
netsuitesdk/internal/__init__.py 0 0 100% | ||
netsuitesdk/internal/client.py 305 79 74% | ||
netsuitesdk/internal/constants.py 4 0 100% | ||
netsuitesdk/internal/exceptions.py 16 3 81% | ||
netsuitesdk/internal/netsuite_types.py 2 0 100% | ||
netsuitesdk/internal/utils.py 40 4 90% | ||
---------------------------------------------------------------------------- | ||
TOTAL 950 99 90% | ||
|
||
``` | ||
|
||
To get an html report, run this command: | ||
|
@@ -256,7 +292,7 @@ To get an html report, run this command: | |
python -m pytest --cov=netsuitesdk --cov-report html:cov_html | ||
``` | ||
|
||
We want to maintain code coverage of more than 95% for this project at all times. | ||
We want to maintain code coverage of more than 90% for this project at all times. | ||
|
||
## Documentation | ||
Documentation can be found in the docs/_build/html folder (open index.html) and soon in readthedocs. | ||
|
@@ -265,4 +301,4 @@ as well as `make html` | |
|
||
## Contributions | ||
|
||
We are actively accepting contributions. Please mail [email protected] if you wish to collaborate on this. | ||
We are actively accepting contributions. Please mail [email protected] if you wish to collaborate on this. (Please write test cases for new additions.) |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
zeep==3.4.0 | ||
pytest==5.2.4 | ||
pytest==7.2.1 | ||
pytest-cov==2.8.1 | ||
pytest-mock==1.11.2 |
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
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,36 @@ | ||
{ | ||
"billingSchedule": { | ||
"externalId": null, | ||
"internalId": 1, | ||
"type": "billingSchedule" | ||
}, | ||
"cashSaleForm": null, | ||
"class": null, | ||
"createdBy": null, | ||
"createdDate": null, | ||
"currency": { | ||
"name": "USA", | ||
"internalId": null, | ||
"externalId": null, | ||
"type": "currency" | ||
}, | ||
"customer": { | ||
"externalId": null, | ||
"internalId": 1, | ||
"type": "customer" | ||
}, | ||
"customForm": null, | ||
"department": null, | ||
"frequency": null, | ||
"inactive": null, | ||
"invoiceForm": null, | ||
"lastBillCycleDate": null, | ||
"lastBillDate": null, | ||
"location": null, | ||
"memo": "Testing BillingAccounts using Fyle SDK", | ||
"name": "Test Case Account", | ||
"nextBillCycleDate": null, | ||
"startDate": "2022-07-21T17:32:28Z", | ||
"subsidiary": null, | ||
"externalId": "1237" | ||
} |
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,81 @@ | ||
{ | ||
"externalId": "1237", | ||
"account": null, | ||
"altHandlingCost": null, | ||
"altShippingCost": null, | ||
"amountPaid": null, | ||
"amountRemaining": null, | ||
"autoApply": null, | ||
"billAddressList": null, | ||
"billingAddress": null, | ||
"class": null, | ||
"createdDate": null, | ||
"createdFrom": null, | ||
"currency": null, | ||
"currencyName": null, | ||
"customForm": null, | ||
"deferredRevenue": null, | ||
"department": null, | ||
"discountItem": null, | ||
"discountRate": null, | ||
"discountTotal": null, | ||
"email": null, | ||
"entityTaxRegNum": null, | ||
"estGrossProfit": null, | ||
"estGrossProfitPercent": null, | ||
"excludeCommission": null, | ||
"fax": null, | ||
"handlingCost": null, | ||
"handlingTax1Rate": null, | ||
"handlingTax2Rate": null, | ||
"handlingTaxCode": null, | ||
"isMultiShipTo": null, | ||
"isTaxable": null, | ||
"itemList": [], | ||
"job": null, | ||
"lastModifiedDate": null, | ||
"leadSource": null, | ||
"location":null, | ||
"memo": "Testing CreditMemos using Fyle SDK", | ||
"nexus": null, | ||
"partner": null, | ||
"postingPeriod": null, | ||
"promoCode": null, | ||
"recognizedRevenue": null, | ||
"revenueStatus": null, | ||
"revRecOnRevCommitment": null, | ||
"shipMethod": null, | ||
"shippingCost": null, | ||
"shippingTax1Rate": null, | ||
"shippingTax2Rate": null, | ||
"shippingTaxCode": null, | ||
"source": null, | ||
"status": null, | ||
"subsidiary": null, | ||
"subsidiaryTaxRegNum": null, | ||
"subTotal": null, | ||
"tax2Total": null, | ||
"taxDetailsOverride": null, | ||
"taxItem": null, | ||
"taxPointDate": null, | ||
"taxRate": null, | ||
"taxRegOverride": null, | ||
"taxTotal": null, | ||
"toBeEmailed": null, | ||
"toBeFaxed": null, | ||
"toBePrinted": null, | ||
"total": null, | ||
"totalCostEstimate": null, | ||
"tranDate": null, | ||
"tranId": null, | ||
"tranIsVsoeBundle": null, | ||
"unapplied": null, | ||
"vatRegNum": null, | ||
"vsoeAutoCalc": null, | ||
"entity": { | ||
"name": null, | ||
"internalId": "1", | ||
"externalId": null, | ||
"type": "vendor" | ||
} | ||
} |
Oops, something went wrong.