Commit Graph

180 Commits

Author SHA1 Message Date
mike12345567 697cd8b4ea Adding test cases as per PR comments. 2023-01-25 18:27:58 +00:00
Adria Navarro 6259ffad3b Wipe db before tests 2023-01-24 18:51:15 +00:00
Adria Navarro 9371f19419 Remove mocks 2023-01-24 17:48:49 +00:00
Adria Navarro 26fa3bd484 tweak tests 2023-01-24 15:46:50 +00:00
Adria Navarro d1d8ce3611 Move more stuff to .env.test 2023-01-23 18:02:28 +00:00
Adria Navarro d6f0e5b1ec Dry, moving env variables to a .env.test file 2023-01-23 17:41:32 +00:00
Adria Navarro 98aa60879f Set parameters 2023-01-23 16:53:34 +00:00
Adria Navarro 106563c449 Use couchdb from docker container 2023-01-23 16:45:06 +00:00
Adria Navarro 46994a45f9 Update openapi specs 2023-01-20 12:12:59 +00:00
Adria Navarro 27171e7680 Extra typings 2023-01-20 11:48:11 +00:00
Adria Navarro 62b372ce59 Fix broken tests 2023-01-20 10:29:11 +00:00
Adria Navarro bcfb0f3727 Change tests to use internal apis 2023-01-19 17:23:48 +00:00
Adria Navarro e13433557a Add search test 2023-01-19 11:00:51 +00:00
Adria Navarro 233f54f036 Add update test 2023-01-18 17:11:52 +00:00
Adria Navarro 4ae43f1a96 Retrieve row test 2023-01-18 16:46:40 +00:00
Adria Navarro 6bc658c1ff Fix types 2023-01-18 11:50:00 +00:00
Adria Navarro 1d66110d01 More typings 2023-01-18 10:45:42 +00:00
Adria Navarro cc930097a8 Implement test 2023-01-17 17:39:59 +00:00
Adria Navarro 89e0610600 Add basic test 2023-01-17 17:22:31 +00:00
Adria Navarro da8f7eff6c Delete apps on end 2023-01-17 10:28:51 +00:00
Adria Navarro 343a19250b Typing supertest parameters 2023-01-16 15:35:41 +00:00
mike12345567 fc5f6ca530 Adding the ability to store environment variables to context, to make them more easily available/re-usable, as well as exposing them to queries. 2023-01-13 19:53:46 +00:00
mike12345567 75df57c3d1 Merge branch 'develop' of github.com:Budibase/budibase into feature/test-image 2023-01-11 10:31:57 +00:00
Rory Powell fba7ef26ad Replace ts-jest with swc/jest (#9289)
- Add swc dependencies
- Add transform change to jest.config.ts
- Replace `export =` with `export default` in src code to enable code coverage to work with swc transformer
- Restructure backend-core errors package to allow for exporting error classes with ESM syntax
- Update backend-core to no longer use `export =`, export individual packages instead of replacing with `export default` for backwards compatibility
- Update event publishers to use `export default` - this was required for the `jest.spyOn` usage inside backend-core common mocks
- Restructure some jest.mock usages where declaring the jest.fn as a variable outside of the package mock threw an error
2023-01-11 09:37:37 +00:00
mike12345567 ea5b515783 Playing around with getting tests working. 2023-01-04 19:47:56 +00:00
Martin McKeaveney 84ab7862d1 fixes for google sheets, admin checklist, and deleting an app from API (#8846)
* fixes for google sheets, admin checklist, and deleting an app from API

* code review

* splitting unpublish endpoint, moving deploy endpoint to applications controller. Still to do public API work and move deployment controller into application controller

* updating REST method for unpublish in API test

* unpublish and publish endpoint on public API, delete endpoint unpublishes and deletes app

* removing skip_setup from prodAppDb call

* removing commented code

* unit tests and open API spec updates

* unpublish, publish unit tests - delete still in progress

* remove line updating app name in API test

* unit tests

* v2.1.46

* Update pro version to 2.1.46

* v2.2.0

* Update pro version to 2.2.0

* Fix for budibase plugin skeleton, which utilises the old import style.

* Fix side nav styles

* v2.2.1

* Update pro version to 2.2.1

* using dist folder to allow importing constants for openAPI specs

* v2.2.2

* Update pro version to 2.2.2

* Fix for user enrichment call (updating to @budibase/nano fork) (#9038)

* Fix for #9029 - this should fix the issue users have been experiencing with user enrichment calls in apps, essentially it utilises a fork of the nano library we use to interact with CouchDB, which has been updated to use a POST request rather than a GET request as it supports a larger set of data being sent as query parameters.

* Incrementing Nano version to attempt to fix yarn registry issues.

* v2.2.3

* Update pro version to 2.2.3

* Fix SQL table `_id` filtering (#9030)

* Re-add support for filtering on _id using external SQL tables and fix filter key prefixes not working with _id field

* Remove like operator from internal tables and only allow basic operators on SQL table _id column

* Update data section filtering to respect new rules

* Update automation section filtering to respect new rules

* Update dynamic filter component to respect new rules

* v2.2.4

* Update pro version to 2.2.4

* lock changes (#9047)

* v2.2.5

* Update pro version to 2.2.5

* Make looping arrow point in right direction (#9053)

* v2.2.6

* Update pro version to 2.2.6

* Types/attaching license to account (#9065)

* adding license type to account

* removing planDuration

* v2.2.7

* Update pro version to 2.2.7

* Environment variable type coercion fix (#9074)

* Environment variable type coercion fix

* Update .gitignore

* v2.2.8

* Update pro version to 2.2.8

* tests passing

* all tests passing, updates to public API response

* update unpublish call to return 204, openAPI spec and unit

* fixing API tests

Co-authored-by: Budibase Release Bot <>
Co-authored-by: mike12345567 <me@michaeldrury.co.uk>
Co-authored-by: Andrew Kingston <andrew@kingston.dev>
Co-authored-by: melohagan <101575380+melohagan@users.noreply.github.com>
Co-authored-by: Rory Powell <rory.codes@gmail.com>
2022-12-19 13:18:00 +00:00
Rory Powell 786039055e File authentication using presigned URLs (#8883)
* file auth wip

* Private plugin bucket wip

* Add etag to logo request, fix circular dependency

* Resolve cyclic dependency

* Ensure browser doesn't cache custom component

* Global file fixes

* File fixes / remove permaUrl

* Add ctx local storage

* Enable presigned url to work from any host

* Test fix

* Self hosting w/ S3 + other fixes

* Fix for serving dev app in multi tenant

* Fix backup restore and import attachment url processing, never store attachment urls

* Test fixes

* Unit tests WIP

* Replace file path with base64 encoded private key

* Multi tenancy tests for files

* Environment files fixes

* Post-merge build and test fixes

* Add debug conditional to all jest logging and revert/fix prod minio proxy_pass

* Re-add default '/' minio route :(

* Rename iconFile -> iconFileName

* Add cloudfront vars to k8s templates

* Remove public bucket policy

* Remove duplicated test
2022-12-15 11:35:22 +00:00
Peter Clement 9d841bc947 Server and Worker tests (#8928)
* automation unit tests

* row processor tests

* update executeQuery test

* update groups assertion

* some more worker tests

* plugin tests and tidying up

* linting

* temporarily disable group tests

* more tests

* fix import

* fix backup tests

* add pro mocks to worker

* check for app existence in import test

* test new tsconfig

* testing changes

* Pro test utils (#9020)

* Pro test utils changes

* Add test fixes

* Remove ts-ignore

Co-authored-by: mike12345567 <me@michaeldrury.co.uk>
Co-authored-by: Rory Powell <rory.codes@gmail.com>
2022-12-12 22:02:32 +00:00
mike12345567 a02e9017ec Final fixes after re-running all test suites. 2022-11-28 19:12:23 +00:00
mike12345567 e62ebc8fbb Updates to fix build. 2022-11-28 13:24:39 +00:00
mike12345567 de82eca502 Some typescript conversions, moving a few imports around. 2022-11-21 18:33:34 +00:00
mike12345567 31c198888a Updating some enums, plural to single. 2022-11-17 14:59:18 +00:00
mike12345567 4328ed1b67 Updating middlewares to Typescript, as well as some fixes based on running tests. 2022-11-16 17:24:13 +00:00
mike12345567 535fab7997 Some major reworks towards higher levels of typescript. 2022-11-16 17:23:12 +00:00
Rory Powell f48ff01045 ensure fetch and aws are always mocked 2022-11-15 15:50:15 +00:00
Rory Powell 9973f2e161 Bump jest and ts-jest to be consistent across backend packages to fix CI issue, test config updates 2022-11-14 22:55:47 +00:00
mike12345567 3d98acc28a Minor test rework after improving startup, a lot of mocks weren't being used correctly. 2022-10-27 15:15:08 +01:00
Rory Powell 5614c5db61 Replace isTest check with mock for triggering app backup 2022-10-24 13:05:40 +01:00
mike12345567 8744d0a86c Renaming data source -> datasource as per Mel's request. 2022-09-14 12:11:20 +01:00
mike12345567 b803a3fd93 Replacing all plural TS enumerations with singular - this involves a major rename of the DocumentTypes. 2022-08-11 13:50:05 +01:00
Rory Powell 500e697974 Trigger served events on ping endpoint 2022-08-10 11:01:54 +01:00
mike12345567 3b4d7950d0 Merge branch 'master' of github.com:Budibase/budibase into fix/memory-leak 2022-07-14 16:40:23 +01:00
Rory Powell 1c4473ba30 WIP: Memory leak fix 2022-07-13 08:22:21 -04:00
Dean 28f722cf4b Fixes for Rest API request UI. Rest test fixes for XML API request body. Fix for raw XML api request body parsing issue. General fixes for query testing. 2022-06-17 12:00:42 +01:00
Rory Powell 7ebfaf8a31 Failover protection with event cache 2022-05-31 21:04:41 +01:00
Rory Powell 4841c84861 Merge branch 'feature/posthog-v2' into feature/event-backfill 2022-05-23 10:29:33 +01:00
Rory Powell 443b664e33 Finish global migration 2022-05-20 21:16:29 +01:00
Rory Powell 756f5b51aa App migrations finished 2022-05-20 12:29:31 +01:00
Rory Powell 8da427284c Stub out migrations + start tests + add build watching for backend-core 2022-05-18 10:56:44 +01:00
Rory Powell 1caf4b1965 Merge branch 'develop' into feature/posthog-v2 2022-04-27 16:32:00 +01:00
mike12345567 345bbf603c Fixing issues with test cases - a lot of test cases didn't setup tenancy in any format, which now means that the API endpoints they call would not have access to a Global DB instance. Also had to disable the closing of the database in test as this was removing the database from memory, meaning future calls would find an empty database when they opened it. 2022-04-21 14:56:14 +01:00
mike12345567 151ed604f8 Fixing some issues detected by the test cases, making the in-use mechanism for context more clear to complete avoid stack up of contexts (leading to loss of knowledge around previous databases. 2022-04-20 23:10:39 +01:00
mike12345567 192fb1307e Initial version of memory leak protection, making sure that PouchDB databases are closed correctly after use, using a combination of closures wrapping DB gets (this replaces the getDB, leaving only a dangerousGetDB function which can be used in very very specific scenarios) and then closing the DB as part of CLS hooked functions finishing. Also moving the GlobalDB init to the tenancy middleware as this is used everywhere in the worker/app services - means that not all getGlobalDB calls require an async closure around them. 2022-04-19 19:42:52 +01:00
Rory Powell 41144db055 Remove remaining direct usage of CouchDB. Add common pouch config to backend-core 2022-04-19 16:45:27 +01:00
Rory Powell 33719fcb09 Merge branch 'feature/licensing' into feature/posthog-v2 2022-04-12 17:12:46 +01:00
Rory Powell befb61c915 smtp events + centralise worker test config 2022-04-06 17:00:17 +01:00
Rory Powell ec4e9df4c2 Refactor automation tests to run independently 2022-04-06 12:34:31 +01:00
Rory Powell 6128dfadcf Logout events 2022-04-05 16:56:28 +01:00
Rory Powell 8d39bf9f2e sso auth + datasource events, test updates 2022-04-05 15:46:04 +01:00
Rory Powell d0af6cc8ca App events 2022-04-04 15:59:00 +01:00
Rory Powell 15b676ce1c Remove remaining direct usage of CouchDB. Add common pouch config to backend-core 2022-03-29 16:03:44 +01:00
Rory Powell 819f9b75de Link app context with tenancy, remove app tenancy middleware 2022-03-24 13:04:49 +00:00
mike12345567 84ef694712 Fixing test case. 2022-02-28 18:53:03 +00:00
mike12345567 83d4994f55 Starting to fix up test cases. 2022-02-25 15:55:19 +00:00
Michael Drury 01bb56cbf4 Adding a testing system which generates the schema and compares against responses. 2022-02-24 23:21:10 +00:00
Maurits Lourens a3626986a1 fix tests 2022-02-11 17:28:19 +01:00
mike12345567 476f34fb93 Merge branch 'develop' of github.com:Budibase/budibase into lab-day/refactor-app-db 2022-01-31 17:16:59 +00:00
mike12345567 e718b18127 Merge branch 'develop' of github.com:Budibase/budibase into lab-day/refactor-app-db 2022-01-31 14:09:07 +00:00
Rory Powell 54a32b41ef Merge branch 'develop' into feature/migrations-2.0 2022-01-30 22:37:11 +00:00
mike12345567 d5f8cc1023 Tests updating, all now passing, fixed some issues discovered by them. 2022-01-28 15:43:51 +00:00
Michael Drury d3a90acc55 Final pass refactoring - need to test but all code in server converted. 2022-01-28 00:05:39 +00:00
mike12345567 d2fe119d90 Main body of work, refactoring most usages. 2022-01-27 18:18:31 +00:00
Rory Powell 767354ad60 Add app db support + app url migration 2022-01-27 10:40:31 +00:00
Rory Powell ffcf5354eb Add CSRF Token 2022-01-25 22:54:50 +00:00
Rory Powell e0dcc7648c Remove server -> worker request to retrieve apps, remove hosting endpoints and store 2022-01-21 17:31:18 +00:00
mike12345567 5ee6aa24b2 Refactoring core library usage in monorepo, make it a bit cleaner/easier to search/more standardised. 2022-01-12 11:32:14 +00:00
mike12345567 37d0617ace Renaming some variables to core, fixing test cases that referenced auth directly. 2022-01-11 16:18:30 +00:00
mike12345567 b33523a73d Merge branch 'develop' of github.com:Budibase/budibase into feature/auth-core 2022-01-11 15:16:07 +00:00
Rory Powell cc338f03df Invalidate dynamic variables when they are removed from datasource 2022-01-11 10:35:53 +00:00
mike12345567 1327394784 Switching out @budibase/auth to @budibase/backend-core. 2022-01-10 19:33:00 +00:00
mike12345567 44a8d36c91 Adding basic test cases for static and dynamic variables (backend). 2022-01-04 18:23:45 +00:00
mike12345567 89d04d5cc7 Merge branch 'develop' of github.com:Budibase/budibase into fix/sql-issues 2021-10-27 14:51:43 +01:00
mike12345567 fa38a4b37e Fixing test cases. 2021-10-27 13:10:46 +01:00
Rory Powell 67f851b68c Update app id check in tests 2021-10-26 16:21:26 +01:00
Rory Powell ad61f2af3b Prevent non builder from accessing dev apps 2021-10-25 16:59:09 +01:00
Peter Clement 01265b0b02 fix tests 2021-09-28 15:29:42 +01:00
mike12345567 46ea3f3e9e Revert "Merge pull request #2253 from Budibase/revert-2076-feature/multi-tenants"
This reverts commit 4834b765be, reversing
changes made to 2456e69483.
2021-08-05 09:59:08 +01:00
Michael Drury b86a6fddc9 Revert "Multi-tenancy/organisations" 2021-08-04 10:02:24 +01:00
mike12345567 7743384f77 re-write, to use the ideas that Rory put in place, still WIP, un-tested but all implemented. 2021-08-02 18:34:43 +01:00
mike12345567 4160d63b2d Merge branch 'fix/lucene-filtering' of github.com:Budibase/budibase into feature/multi-tenants 2021-07-23 16:10:59 +01:00
mike12345567 fa3cf585d7 Adding concept of version to APIs. 2021-07-23 15:29:14 +01:00
mike12345567 3f7bafe23d Linting. 2021-07-22 22:37:20 +01:00
mike12345567 313302cae2 Fixing test cases and bugs that they raised. 2021-07-22 22:36:16 +01:00
mike12345567 b7995dd61d Updating auth to utilise the tenant system. 2021-07-16 15:08:58 +01:00
mike12345567 912659a8ad First version of multi-tenancy, work still to be done. 2021-07-15 17:57:02 +01:00
mike12345567 b0fb7ae991 Fixing test cases. 2021-07-08 00:30:55 +01:00
mike12345567 f0e7b9b25e Speeding up server tests and removing the ability for it to port collide. 2021-06-25 16:14:06 +01:00
mike12345567 96fd8ed947 Updating tests to use latest version of jest, which broke a lot of things, but was necessary to get proper ts-jest support. 2021-06-25 13:46:02 +01:00
Martin McKeaveney f8fdae0604 automation server tests updated 2021-06-17 16:35:58 +01:00
mike12345567 33184be064 Re-writing how global users are handled in server, specifically how they are retrieved, so that for relationships it can handle the global user. 2021-06-08 16:06:30 +01:00