Skip to content

CI: run the JavaScript and Elixir SDK unit tests on pull requests #520

Description

@rajarshidattapy

Area: .github/workflows/ci.yml, sdks/javascript/sdk, sdks/elixir/sdk

Problem

CI only tests the Python SDK (python-sdk-test, 3.10–3.14 matrix). The other SDKs in sdks/ have test suites that no workflow runs. Searching .github/workflows/ for sdks/javascript, sdks/elixir, mix test, go test, or swift test finds nothing.

SDK Tests in repo Run in CI?
Python sdks/python/sdk tests/ yes
JavaScript sdks/javascript/sdk (@moss-dev/moss) test/*.test.ts (vitest) no
Elixir sdks/elixir/sdk test/moss/*_test.exs (ExUnit) no
Go sdks/go/sdk client_test.go, mutation_test.go no (in progress in PR #501)

A PR can break the JS or Elixir SDK and still pass every check.

Both suites can already run without secrets

JavaScript:

  • vitest.config.ts already excludes the benchmark and cloud-version suites (search.test.ts, create_index_versions.test.ts).
  • The cloud suites (cloudFallback, customEmbeddings, hotReload, mossClient.imageDataset, mossClientE2e) are gated with describe.skipIf(!HAS_REAL_CLOUD_CREDS), which reads MOSS_TEST_PROJECT_ID / MOSS_TEST_PROJECT_KEY in test/constants.ts.
  • helpers.test.ts and mossClient.test.ts run offline.

Elixir:

  • test/test_helper.exs has ExUnit.start(exclude: [:integration, :embedding, :session]), so a plain mix test runs only the offline tests.
  • The native core (sdks/elixir/bindings, {:moss_core, path: "../bindings"}) uses rustler_precompiled, so CI shouldn't need a Rust toolchain unless a force-build flag is set. Confirm this while implementing.

Proposed solution

Add two jobs to .github/workflows/ci.yml, or a new sdk-tests.yml with paths: filters so they only run when the SDK changes.

javascript-sdk-test

  • actions/setup-node with Node 20 and 22, cache-dependency-path: sdks/javascript/sdk/package-lock.json
  • npm ci, npm run lint, npx tsc --noEmit, npm test
  • Check that the @moss-dev/moss-core native addon installs on ubuntu-latest. The config sets pool: 'forks' because of native-addon issues, so keep that.

elixir-sdk-test

  • erlef/setup-beam with an OTP/Elixir pair matching mix.exs
  • cache deps and _build
  • mix deps.get, mix format --check-formatted, mix compile --warnings-as-errors, mix test

Optional: a separate job that runs the cloud suites only on push to main when MOSS_TEST_PROJECT_ID / MOSS_TEST_PROJECT_KEY secrets exist, following the pattern of NEXT_PUBLIC_MOSS_PROJECT_* in next-js-test.

Acceptance criteria

  • A PR that changes sdks/javascript/sdk/** runs lint, type-check, and offline vitest, and fails on a broken test.
  • A PR that changes sdks/elixir/sdk/** or sdks/elixir/bindings/** runs mix test (integration/embedding/session tags excluded).
  • Neither job needs repository secrets on fork PRs.
  • If lint or format checks fail on the current code, the fixes land in the same PR, or those steps start as non-blocking with a follow-up issue.
  • CONTRIBUTING.md or each SDK README documents how to run these tests locally.

Overlap check

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions