-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working parsing * tests timeouts * tests errors * test CI * any worker * runs on * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * CI timeout tests * added sudo * ci * remove tls CI --------- Co-authored-by: aminediro <[email protected]>
- Loading branch information
Showing
9 changed files
with
390 additions
and
55 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,87 @@ | ||
name: Run Tests API and Worker | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
NATS_TOKEN: test | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 👀 Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup apt cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /var/cache/apt/archives | ||
key: ${{ runner.os }}-apt-${{ hashFiles('/etc/apt/sources.list') }} | ||
|
||
- name: 😭 Install system dependencies | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y \ | ||
netcat \ | ||
unzip \ | ||
libgeos-dev \ | ||
libcurl4-openssl-dev \ | ||
libssl-dev \ | ||
binutils \ | ||
curl \ | ||
git \ | ||
autoconf \ | ||
automake \ | ||
build-essential \ | ||
libtool \ | ||
gcc \ | ||
libmagic-dev \ | ||
poppler-utils \ | ||
tesseract-ocr \ | ||
libreoffice \ | ||
libpq-dev \ | ||
pandoc | ||
- name: 🔽 Download and Install NATS Server | ||
run: | | ||
curl -L https://github.com/nats-io/nats-server/releases/download/v2.10.22/nats-server-v2.10.22-linux-amd64.zip -o nats-server.zip | ||
unzip nats-server.zip -d nats-server && sudo cp nats-server/nats-server-v2.10.22-linux-amd64/nats-server /usr/bin | ||
- name: 🛠️ Set up NATS arguments | ||
run: | | ||
nohup nats-server \ | ||
--addr 0.0.0.0 \ | ||
--port 4222 \ | ||
--auth "$NATS_TOKEN" > nats.log 2>&1 & | ||
- name: 🔍 Verify NATS Server is Running | ||
run: | | ||
sleep 1 # Give the server some time to start | ||
if nc -zv localhost 4222; then | ||
echo "✅ NATS Server is running on port 4222." | ||
else | ||
echo "❌ Failed to start NATS Server." | ||
cat nats.log | ||
exit 1 | ||
fi | ||
- name: 🔨 Install the latest version of rye | ||
uses: eifinger/setup-rye@v4 | ||
with: | ||
enable-cache: true | ||
|
||
- name: 🎯 Cache hit! | ||
if: steps.setup-rye.outputs.cache-hit == 'true' | ||
run: echo "Rye cache was restored" | ||
|
||
- name: 🔄 Sync dependencies | ||
run: | | ||
UV_INDEX_STRATEGY=unsafe-first-match rye sync --no-lock | ||
- name: 🚀 Run tests | ||
run: | | ||
rye test -p megaparse-sdk |
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 |
---|---|---|
|
@@ -17,9 +17,9 @@ class MegaParseConfig(BaseSettings): | |
|
||
|
||
class SSLConfig(BaseModel): | ||
ca_cert_file: FilePath | ||
ssl_key_file: FilePath | ||
ssl_cert_file: FilePath | ||
ca_cert_file: FilePath | None = None | ||
|
||
|
||
class ClientNATSConfig(BaseSettings): | ||
|
@@ -28,7 +28,10 @@ class ClientNATSConfig(BaseSettings): | |
) | ||
subject: Literal["parsing"] = "parsing" | ||
endpoint: str = "https://[email protected]:4222" | ||
timeout: int = 600 | ||
timeout: float = 600 | ||
max_retries: int = 5 | ||
backoff: int = 3 | ||
backoff: float = 3 | ||
connect_timeout: int = 5 | ||
reconnect_time_wait: int = 1 | ||
max_reconnect_attempts: int = 20 | ||
ssl_config: SSLConfig | None = None |
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
Empty file.
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,29 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIFCzCCA3OgAwIBAgIQESt0eck2KvFrAMyiDyceujANBgkqhkiG9w0BAQsFADCB | ||
nTEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMTkwNwYDVQQLDDBhbWlu | ||
ZUBhbWluZXMtTWFjQm9vay1Qcm8ubG9jYWwgKGFtaW5lIGRpcmhvdXNzaSkxQDA+ | ||
BgNVBAMMN21rY2VydCBhbWluZUBhbWluZXMtTWFjQm9vay1Qcm8ubG9jYWwgKGFt | ||
aW5lIGRpcmhvdXNzaSkwHhcNMjQxMTE5MTAwMTA5WhcNMzQxMTE5MTAwMTA5WjCB | ||
nTEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMTkwNwYDVQQLDDBhbWlu | ||
ZUBhbWluZXMtTWFjQm9vay1Qcm8ubG9jYWwgKGFtaW5lIGRpcmhvdXNzaSkxQDA+ | ||
BgNVBAMMN21rY2VydCBhbWluZUBhbWluZXMtTWFjQm9vay1Qcm8ubG9jYWwgKGFt | ||
aW5lIGRpcmhvdXNzaSkwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCw | ||
6TX1kvqVMb8ZUQVT/vuDsedmbYgSFn68yJRlmE9BsqG7TLQHl2Kw6VQqZBSIkeZG | ||
CypmUysX/3qrvICeArIdmmsrWUTDYPoauw/a/RY0I07rALj3YR0Y7039Hxf/UPT9 | ||
xlUtnM2NafkZyp6WRjEN0N4ETvJDIbUQiosiiPilxhwRbJURhT/JPskaw+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