Skip to content

Commit

Permalink
Check data against stable branch (#84)
Browse files Browse the repository at this point in the history
* Check data against stable branch

* Separate tests for master and stable

* Ensure each allocation has a shipment
  • Loading branch information
SchrodingersGat authored Nov 18, 2024
1 parent 6d96215 commit b545c12
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 14 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/import_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,42 @@ name: Import Dataset
on: ["push", "pull_request"]

jobs:
build:
stable:
runs-on: ubuntu-latest

env:
INVENTREE_DB_ENGINE: sqlite3
INVENTREE_DB_NAME: inventree_db.sqlite3
INVENTREE_DB_NAME: inventree_db_stable.sqlite3
INVENTREE_BACKUP_DIR: $GITHUB_WORKSPACE/path/to/backup
INVENTREE_MEDIA_ROOT: $GITHUB_WORKSPACE/path/to/media
INVENTREE_STATIC_ROOT: $GITHUB_WORKSPACE/path/to/static

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install InvenTree
run: |
sudo apt-get install python3-dev python3-pip python3-venv python3-wheel g++
pip3 install invoke
git clone --depth 1 https://github.com/inventree/inventree inventree -b stable
cd inventree
invoke install
- name: Import Database Records
run: |
cd inventree
invoke migrate
invoke import-records -c -f $GITHUB_WORKSPACE/inventree_data.json
latest:
runs-on: ubuntu-latest

env:
INVENTREE_DB_ENGINE: sqlite3
INVENTREE_DB_NAME: inventree_db_latest.sqlite3
INVENTREE_BACKUP_DIR: $GITHUB_WORKSPACE/path/to/backup
INVENTREE_MEDIA_ROOT: $GITHUB_WORKSPACE/path/to/media
INVENTREE_STATIC_ROOT: $GITHUB_WORKSPACE/path/to/static
Expand Down
74 changes: 62 additions & 12 deletions inventree_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -45471,7 +45471,7 @@
"part": 74,
"sale_price_currency": "USD",
"sale_price": "12.450000",
"shipped": "0.00000"
"shipped": "1.00000"
}
},
{
Expand Down Expand Up @@ -46430,7 +46430,7 @@
"pk": 91,
"fields": {
"line": 27,
"shipment": null,
"shipment": 12,
"item": 1286,
"quantity": "1.00000"
}
Expand All @@ -46440,7 +46440,7 @@
"pk": 92,
"fields": {
"line": 27,
"shipment": null,
"shipment": 14,
"item": 1294,
"quantity": "1.00000"
}
Expand All @@ -46450,7 +46450,7 @@
"pk": 93,
"fields": {
"line": 27,
"shipment": null,
"shipment": 12,
"item": 1295,
"quantity": "1.00000"
}
Expand All @@ -46460,7 +46460,7 @@
"pk": 94,
"fields": {
"line": 29,
"shipment": null,
"shipment": 7,
"item": 1288,
"quantity": "1.00000"
}
Expand All @@ -46470,7 +46470,7 @@
"pk": 95,
"fields": {
"line": 29,
"shipment": null,
"shipment": 13,
"item": 1287,
"quantity": "1.00000"
}
Expand All @@ -46480,7 +46480,7 @@
"pk": 96,
"fields": {
"line": 29,
"shipment": null,
"shipment": 7,
"item": 1289,
"quantity": "1.00000"
}
Expand Down Expand Up @@ -88981,7 +88981,7 @@
"pk": 1,
"fields": {
"password": "pbkdf2_sha256$600000$eW6hr1msXY3U1vkqy3K4wd$/egntyTaLBCUPnM1nM2LIbbDGjKfccvIOgexovlFKjo=",
"last_login": "2024-11-08T13:41:20.839Z",
"last_login": "2024-11-18T13:48:17.277Z",
"is_superuser": true,
"username": "admin",
"first_name": "",
Expand Down Expand Up @@ -115051,6 +115051,24 @@
}
}
},
{
"model": "stock.stockitemtracking",
"pk": 1391,
"fields": {
"tracking_type": 60,
"item": 1287,
"date": "2024-11-18T13:50:05.056Z",
"notes": null,
"user": [
"admin"
],
"deltas": {
"customer": 34,
"salesorder": 8,
"customer_name": "Customer D"
}
}
},
{
"model": "stock.stockitem",
"pk": 2,
Expand Down Expand Up @@ -164545,14 +164563,14 @@
"notes": null,
"barcode_data": "",
"barcode_hash": "",
"updated": "2024-07-27T05:10:45.490Z",
"updated": "2024-11-18T13:50:05.052Z",
"parent": null,
"part": 74,
"supplier_part": null,
"location": 14,
"location": null,
"packaging": "",
"belongs_to": null,
"customer": null,
"customer": 34,
"serial": "162",
"serial_int": 162,
"link": "",
Expand All @@ -164562,7 +164580,7 @@
"consumed_by": null,
"is_building": false,
"purchase_order": null,
"sales_order": null,
"sales_order": 8,
"expiry_date": null,
"stocktake_date": null,
"stocktake_user": null,
Expand Down Expand Up @@ -204135,6 +204153,38 @@
"link": ""
}
},
{
"model": "order.salesordershipment",
"pk": 13,
"fields": {
"metadata": {},
"notes": null,
"order": 8,
"shipment_date": "2024-11-18",
"delivery_date": null,
"checked_by": null,
"reference": "2",
"tracking_number": "TRK-0001",
"invoice_number": "",
"link": "https://shipping.co/track-123"
}
},
{
"model": "order.salesordershipment",
"pk": 14,
"fields": {
"metadata": {},
"notes": null,
"order": 11,
"shipment_date": null,
"delivery_date": null,
"checked_by": null,
"reference": "SHIP-ABC",
"tracking_number": "TRK-XYZ",
"invoice_number": "INV-123",
"link": ""
}
},
{
"model": "order.salesorder",
"pk": 1,
Expand Down

0 comments on commit b545c12

Please sign in to comment.