Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable test suite to be randomized #7265

Merged
merged 30 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a7dc080
initial run
dplewis Mar 13, 2021
54744a2
Update ParseGraphQLServer.spec.js
dplewis Mar 13, 2021
f6c5a62
temporarily enable reporter
dplewis Mar 13, 2021
2aabbbc
Bump retry limit
dplewis Mar 13, 2021
968c534
fix undefined database
dplewis Mar 13, 2021
37c1054
try to catch error
dplewis Mar 13, 2021
2d237ef
Handle LiveQueryServers
dplewis Mar 13, 2021
8458168
Update Config.js
dplewis Mar 13, 2021
6085eec
fast-fail false
dplewis Mar 13, 2021
56c24ae
Remove usage of AppCache
dplewis Mar 14, 2021
699836a
oops
dplewis Mar 14, 2021
923376b
Update contributing guide
dplewis Mar 14, 2021
f95a193
enable debugger, try network retry attempt 1
dplewis Mar 14, 2021
045bb28
Fix ldap unbinding
dplewis Mar 14, 2021
8ef2120
move non specs to support
dplewis Mar 14, 2021
1f7bee3
add missing mock adapter
dplewis Mar 14, 2021
5c0d697
fix Parse.Push
dplewis Mar 14, 2021
cbea7d0
RestController should match batch.spec.js
dplewis Mar 14, 2021
d211b39
Remove request attempt limit
dplewis Mar 14, 2021
cfd1eff
handle index.spec.js
dplewis Mar 14, 2021
877f366
Update CHANGELOG.md
dplewis Mar 14, 2021
d3883b3
Handle error: tuple concurrently updated
dplewis Mar 14, 2021
6d3c276
test transactions
dplewis Mar 14, 2021
278aa59
Clear RedisCache after every test
dplewis Mar 15, 2021
56bcdb6
LoggerController.spec.js
dplewis Mar 15, 2021
cc20f6d
Update schemas.spec.js
dplewis Mar 15, 2021
869ce52
finally fix transactions
dplewis Mar 15, 2021
b6694d6
fix geopoint deadlock
dplewis Mar 15, 2021
0893e8e
transaction with clean database
dplewis Mar 15, 2021
326a0f4
batch.spec.js
dplewis Mar 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
check-ci:
name: CI Self-Check
timeout-minutes: 30
timeout-minutes: 15
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand All @@ -34,7 +34,7 @@ jobs:
run: npm run ci:check
check-lint:
name: Lint
timeout-minutes: 30
timeout-minutes: 15
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -97,8 +97,9 @@ jobs:
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 15.11.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 30
timeout-minutes: 15
runs-on: ubuntu-18.04
services:
redis:
Expand Down Expand Up @@ -145,8 +146,9 @@ jobs:
POSTGRES_IMAGE: postgis/postgis:12-3.0
- name: Postgres 13, Postgis 3.1
POSTGRES_IMAGE: postgis/postgis:13-3.1
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 30
timeout-minutes: 15
runs-on: ubuntu-18.04
services:
redis:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ ___
- Allow Cloud Validator `options` to be async (dblythy) [#7155](https://github.com/parse-community/parse-server/pull/7155)
- Optimize queries on classes with pointer permissions (Pedro Diaz) [#7061](https://github.com/parse-community/parse-server/pull/7061)
- Test Parse Server continuously against all relevant Postgres versions (minor versions), added Postgres compatibility table to Parse Server docs (Corey Baker) [#7176](https://github.com/parse-community/parse-server/pull/7176)
- Randomize test suite (Diamond Lewis) [#7265](https://github.com/parse-community/parse-server/pull/7265)
- LDAP: Properly unbind client on group search error (Diamond Lewis) [#7265](https://github.com/parse-community/parse-server/pull/7265)
___
## 4.5.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ Once you have babel running in watch mode, you can start making changes to parse
* All the tests should point to sources in the `lib/` folder.
* The `lib/` folder is produced by `babel` using either the `npm run build`, `npm run watch`, or the `npm run prepare` step.
* The `npm run prepare` step is automatically invoked when your package depends on forked parse-server installed via git for example using `npm install --save git+https://github.com/[username]/parse-server#[branch/commit]`.
* The tests are run against a single server instance. You can change the server configurations using `await reconfigureServer({ ... some configuration })` found in `spec/helper.js`.
* The tests are ran at random.
* Caches and Configurations are reset after every test.
* Users are logged out after every test.
* Cloud Code hooks are removed after every test.
* Database is deleted after every test (indexes are not removed for speed)
* Tests are located in the `spec` folder
* For better test reporting enable `PARSE_SERVER_LOG_LEVEL=debug`

### Troubleshooting

Expand All @@ -108,6 +116,7 @@ Once you have babel running in watch mode, you can start making changes to parse
* Run the tests for the whole project to make sure the code passes all tests. This can be done by running the test command for a single file but removing the test file argument. The results can be seen at *<PROJECT_ROOT>/coverage/lcov-report/index.html*.
* Lint your code by running `npm run lint` to make sure the code is not going to be rejected by the CI.
* **Do not** publish the *lib* folder.
* Mocks belong in the `spec/support` folder.
* Please consider if any changes to the [docs](http://docs.parseplatform.org) are needed or add additional sections in the case of an enhancement or feature.

### Test against Postgres
Expand Down
6 changes: 3 additions & 3 deletions spec/AdapterLoader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Config = require('../lib/Config');

describe('AdapterLoader', () => {
it('should instantiate an adapter from string in object', done => {
const adapterPath = require('path').resolve('./spec/MockAdapter');
const adapterPath = require('path').resolve('./spec/support/MockAdapter');

const adapter = loadAdapter({
adapter: adapterPath,
Expand All @@ -23,7 +23,7 @@ describe('AdapterLoader', () => {
});

it('should instantiate an adapter from string', done => {
const adapterPath = require('path').resolve('./spec/MockAdapter');
const adapterPath = require('path').resolve('./spec/support/MockAdapter');
const adapter = loadAdapter(adapterPath);

expect(adapter instanceof Object).toBe(true);
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('AdapterLoader', () => {
});

it('should load custom push adapter from string (#3544)', done => {
const adapterPath = require('path').resolve('./spec/MockPushAdapter');
const adapterPath = require('path').resolve('./spec/support/MockPushAdapter');
const options = {
ios: {
bundleId: 'bundle.id',
Expand Down
6 changes: 6 additions & 0 deletions spec/CLI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ describe('execution', () => {
'test',
'--databaseURI',
'mongodb://localhost/test',
'--port',
'1339',
]);
childProcess.stdout.on('data', data => {
data = data.toString();
Expand All @@ -247,6 +249,8 @@ describe('execution', () => {
'test',
'--databaseURI',
'mongodb://localhost/test',
'--port',
'1340',
'--mountGraphQL',
]);
let output = '';
Expand All @@ -271,6 +275,8 @@ describe('execution', () => {
'test',
'--databaseURI',
'mongodb://localhost/test',
'--port',
'1341',
'--mountGraphQL',
'--mountPlayground',
]);
Expand Down
3 changes: 3 additions & 0 deletions spec/FilesController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ describe('FilesController', () => {
expect(typeof error).toBe('object');
expect(error.message.indexOf('biscuit')).toBe(13);
expect(error.code).toBe(Parse.Error.INVALID_FILE_NAME);
mockAdapter.validateFilename = () => {
return null;
};
done();
});

Expand Down
6 changes: 3 additions & 3 deletions spec/GridFSBucketStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const GridFSBucketAdapter = require('../lib/Adapters/Files/GridFSBucketAdapter')
const { randomString } = require('../lib/cryptoUtils');
const databaseURI = 'mongodb://localhost:27017/parse';
const request = require('../lib/request');
const Config = require('../lib/Config');

async function expectMissingFile(gfsAdapter, name) {
try {
Expand Down Expand Up @@ -395,8 +394,9 @@ describe_only_db('mongo')('GridFSBucket and GridStore interop', () => {
});

it('should handle getMetadata error', async () => {
const config = Config.get('test');
config.filesController.getMetadata = () => Promise.reject();
const gfsAdapter = new GridFSBucketAdapter(databaseURI);
await reconfigureServer({ filesAdapter: gfsAdapter });
gfsAdapter.getMetadata = () => Promise.reject();

const headers = {
'X-Parse-Application-Id': 'test',
Expand Down
Loading