Skip to content

Commit

Permalink
Add back disabled unit tests (#254)
Browse files Browse the repository at this point in the history
* Add back disabled unit tests

* Run prettier on make fix

* Don't minify e2e tests
  • Loading branch information
richarddavison authored Mar 8, 2024
1 parent 2fe0003 commit d0d4cbf
Show file tree
Hide file tree
Showing 53 changed files with 12,786 additions and 7,947 deletions.
4 changes: 2 additions & 2 deletions .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"backend.maxHeapSizeMb": 2048
}
"backend.maxHeapSizeMb": 2048
}
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
### Checklist

- [ ] Created unit tests in `tests/unit` and/or in Rust for my feature if needed
- [ ] Ran `make fix` to format and apply Clippy auto fixes
- [ ] Ran `make fix` to format JS and apply Clippy auto fixes
- [ ] Made sure my code didn't add any additional warnings: `make check`
- [ ] Updated documentation if needed ([API.md](API.md)/[README.md](README.md)/Other)

*By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.*
_By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"AWS_SECRET_ACCESS_KEY": "",
"AWS_SESSION_TOKEN": ""
},
"args": ["test","-d","bundle"],
"args": ["test", "-d", "bundle"],
"cwd": "${workspaceFolder}"
}
]
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cSpell.words": ["Abortable", "rquickjs","LLRT","llrt"],
"cSpell.words": ["Abortable", "rquickjs", "LLRT", "llrt"],
"cmake.configureOnOpen": false,
"rust-analyzer.showUnlinkedFileNotification": false
}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodeLinker: node-modules
nodeLinker: node-modules
59 changes: 33 additions & 26 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API documentation

> [!NOTE]
> [!NOTE]
> The long term goal for LLRT is to become [Winter CG compliant](https://github.com/wintercg/admin/blob/main/proposals.md). Not every API from Node.js will be supported.
## buffer
Expand All @@ -17,8 +17,7 @@ Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/

## child_process

> [!WARNING]
> `spawn` uses native streams that is not 100% compatible with the Node.js Streams API.
> [!WARNING] > `spawn` uses native streams that is not 100% compatible with the Node.js Streams API.
[spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options)

Expand Down Expand Up @@ -48,12 +47,14 @@ Available globally

> [!IMPORTANT]
> There are some differences with the [WHATWG standard](https://fetch.spec.whatwg.org). Mainly browser specific behavior is removed:
> * `keepalive` is always true
> * `request.body` can only be `string`, `Array`, `ArrayBuffer` or `Uint8Array`
> * `response.body` returns `null`. Use `response.text()`, `response.json()` etc
> * `mode`, `credentials`, `referrerPolicy`, `priority`, `cache` is not available/applicable
>
> - `keepalive` is always true
> - `request.body` can only be `string`, `Array`, `ArrayBuffer` or `Uint8Array`
> - `response.body` returns `null`. Use `response.text()`, `response.json()` etc
> - `mode`, `credentials`, `referrerPolicy`, `priority`, `cache` is not available/applicable
## fs

[accessSync](https://nodejs.org/api/fs.html#fsaccesssyncpath-mode)
[mkdirSync](https://nodejs.org/api/fs.html#fsmkdirsyncpath-options)
[readdirSync](https://nodejs.org/api/fs.html#fsreaddirsyncpath-options)
Expand Down Expand Up @@ -83,16 +84,17 @@ Available globally
## hex

```typescript
export function encode(value:string|Array|ArrayBuffer|Uint8Array):string
export function decode(value:string):Uint8Array
export function encode(
value: string | Array | ArrayBuffer | Uint8Array
): string;
export function decode(value: string): Uint8Array;
```

## module

[createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename)
[createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename)

> [!NOTE]
> `require` is available from esm modules natively. This function is just for compatibility
> [!NOTE] > `require` is available from esm modules natively. This function is just for compatibility
## os

Expand Down Expand Up @@ -144,8 +146,8 @@ _Also available globally_

## util

> [!IMPORTANT]
> Supported encodings: hex, base64, utf8, iso88591.
> [!IMPORTANT]
> Supported encodings: hex, base64, utf8, iso88591.
> Supported methods: `encode` & `decode`
[TextEncoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
Expand All @@ -155,24 +157,29 @@ _Also available globally_
## uuid

```typescript
export const NIL: string;

export const NIL:string
export function v1():string
export function v1(): string;

export function v3(name:string, namespace:Array|Uint8Array|String):string
export function v3(
name: string,
namespace: Array | Uint8Array | String
): string;

export function v4():string
export function v4(): string;

export function v5(name:string, namespace:Array|Uint8Array|String):string
export function v5(
name: string,
namespace: Array | Uint8Array | String
): string;

export function parse(value:string):Uint8Array
export function parse(value: string): Uint8Array;

export function stringify(arr:Array|Uint8Array):string
export function stringify(arr: Array | Uint8Array): string;

export function validate(arr:string):boolean
export function validate(arr: string): boolean;

export function version(arr:Array|Uint8Array):number
export function version(arr: Array | Uint8Array): number;
```

## xml
Expand All @@ -195,9 +202,9 @@ export class XMLParser(options?: XmlParserOptions){

## net

> [!WARNING]
> [!WARNING]
> These APIs uses native streams that is not 100% compatible with the Node.js Streams API. Server APIs like `createSever` provides limited functionality useful for testing purposes. Serverless applications typically don't expose servers. Some server options are not supported:
`highWaterMark`, `pauseOnConnect`, `keepAlive`, `noDelay`, `keepAliveInitialDelay`
> `highWaterMark`, `pauseOnConnect`, `keepAlive`, `noDelay`, `keepAliveInitialDelay`
[createConnection](https://nodejs.org/api/net.html#netcreateconnection)

Expand Down
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* Optimized LLRT for containers. Use `llrt-container-arm` or `llrt-container-x64`
* Added a few FS sync APIs
* Embedded more `@smithy` packages
* Minor optimization tweaks
* Bugfixes & dependecy upgrades
- Optimized LLRT for containers. Use `llrt-container-arm` or `llrt-container-x64`
- Added a few FS sync APIs
- Embedded more `@smithy` packages
- Minor optimization tweaks
- Bugfixes & dependecy upgrades
3 changes: 2 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Code of Conduct

This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.
[email protected] with any additional questions or comments.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ We welcome you to use the GitHub issue tracker to report bugs or suggest feature
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment
- A reproducible test case or series of steps
- The version of our code being used
- Any modifications you've made relevant to the bug
- Anything unusual about your environment or deployment

## Contributing via Pull Requests

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
1. You are working against the latest source on the _main_ branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

Expand Down
34 changes: 17 additions & 17 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# Project Governance (Very Minimal Governance model)

This open source project is managed by a Steering Committee composed of the maintainers of this project. Maintainers are
This open source project is managed by a Steering Committee composed of the maintainers of this project. Maintainers are
defined as individuals with full commit access to the project repositories.

## Steering Committee

The Steering Committee will be responsible for oversight of all technical, project, approval, and policy matters for the
The Steering Committee will be responsible for oversight of all technical, project, approval, and policy matters for the
project. This notably includes brand and trademark management.

The Steering Committee members are listed in the MAINTAINERS.md file in the repository. New maintainers (and accordingly,
Steering Committee members) may be added or removed by no less than 3/4 affirmative vote of the Steering Committee. The
The Steering Committee members are listed in the MAINTAINERS.md file in the repository. New maintainers (and accordingly,
Steering Committee members) may be added or removed by no less than 3/4 affirmative vote of the Steering Committee. The
Steering Committee will appoint a Chair responsible for organizing Steering Committee activity. If the Steering Committee
Chair is removed from the Committee (or the Chair steps down from that role), it is the responsibility of the Steering
Chair is removed from the Committee (or the Chair steps down from that role), it is the responsibility of the Steering
Committe to appoint a new Chair.

The Steering Committee may, at its discretion, add or remove members who are not maintainers.
The Steering Committee may, at its discretion, add or remove members who are not maintainers.

## Voting

The Steering Committee will strive for all decisions to be made by consensus. While explicit agreement of the entire
Steering Committee is preferred, it is not required for consensus. Rather, the Steering Committee will determine
consensus based on their good faith consideration of a number of factors, including the dominant view of the Steering
The Steering Committee will strive for all decisions to be made by consensus. While explicit agreement of the entire
Steering Committee is preferred, it is not required for consensus. Rather, the Steering Committee will determine
consensus based on their good faith consideration of a number of factors, including the dominant view of the Steering
Committee and nature of support and objections. The Steering Committee will document evidence of consensus in accordance
with these requirements. If consensus cannot be reached, the Steering Committee will make the decision by a vote.

The Steering Committee Chair will call a vote with reasonable notice to the Steering Committee, setting out a discussion
period and a separate voting period. Any discussion may be conducted in person or electronically by text, voice, or video.
The discussion will be open to the public, with the notable exception of discussions involving embargoed security issues
or the addition or removal of maintainers, which will be private. In any vote, each voting representative will have one
vote. Except as specifically noted elsewhere in this document, decisions by vote require a simple majority vote of all
The discussion will be open to the public, with the notable exception of discussions involving embargoed security issues
or the addition or removal of maintainers, which will be private. In any vote, each voting representative will have one
vote. Except as specifically noted elsewhere in this document, decisions by vote require a simple majority vote of all
voting members.

## Termination of Membership

A maintainer’s access (and accordingly, their position on the Steering Committee) will be removed if any of the following
A maintainer’s access (and accordingly, their position on the Steering Committee) will be removed if any of the following
occur:

* Resignation: Written notice of resignation to the Steering Committee
* Steering Committee Vote: 3/4 affirmative vote of the Steering Committee to remove a member
* Unreachable Member: If a member is unresponsive for more than six months, the remaining active members of the Steering
- Resignation: Written notice of resignation to the Steering Committee
- Steering Committee Vote: 3/4 affirmative vote of the Steering Committee to remove a member
- Unreachable Member: If a member is unresponsive for more than six months, the remaining active members of the Steering
Committee may vote to remove the member

## License of this document

This document is a modified work of the GitHub Minimal Viable Governance model, located here: 
[https://github.com/github/MVG/](https://github.com/github/MVG/)
[https://github.com/github/MVG/](https://github.com/github/MVG/)
This document may be used, modified, and/or distributed under the terms of the 
[Creative Commons Attribution 4.0 International (CC-BY) license](https://creativecommons.org/licenses/by/4.0/legalcode).
21 changes: 11 additions & 10 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<!-- markdownlint-disable MD043 -->

## Table of contents <!-- omit in toc -->

- [Overview](#overview)
- [Current Maintainers](#current-maintainers)
- [Labels](#labels)
- [Maintainer Responsibilities](#maintainer-responsibilities)
- [Uphold Code of Conduct](#uphold-code-of-conduct)
- [Prioritize Security](#prioritize-security)
- [Review Pull Requests](#review-pull-requests)
- [Triage New Issues](#triage-new-issues)
- [Uphold Code of Conduct](#uphold-code-of-conduct)
- [Prioritize Security](#prioritize-security)
- [Review Pull Requests](#review-pull-requests)
- [Triage New Issues](#triage-new-issues)

## Overview

Expand All @@ -18,10 +19,10 @@ This is document explains who the maintainers are (see below), what they do in t

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| ----------------- | ------------------------------------------------------- | ----------- |
| Richard Davison | [richarddavison](https://github.com/richarddavison) | Amazon |
| Nik Pinski | [nikp](https://github.com/nikp) | Amazon |
| Maintainer | GitHub ID | Affiliation |
| --------------- | --------------------------------------------------- | ----------- |
| Richard Davison | [richarddavison](https://github.com/richarddavison) | Amazon |
| Nik Pinski | [nikp](https://github.com/nikp) | Amazon |

## Labels

Expand Down Expand Up @@ -59,8 +60,8 @@ See [Common scenarios](#common-scenarios) section for additional guidance.

Manage [labels](#labels), review issues regularly, and create new labels as needed by the project. Remove `triage` label when you're able to confirm the validity of a request, a bug can be reproduced, etc. Give priority to the original author for implementation, unless it is a sensitive task that is best handled by maintainers.

Make sure issues are assigned to our [board of activities](https://github.com/orgs/awslabs/projects/145/)
Make sure issues are assigned to our [board of activities](https://github.com/orgs/awslabs/projects/145/)

Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might need additional feedback from the author, other customers, experienced community members and/or maintainers.

> WORK IN PROGRESS
> WORK IN PROGRESS
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ bundle/%.js: $(TS_SOURCES)
node build.mjs

fix:
npx pretty-quick
cargo fix --allow-dirty
cargo clippy --fix --allow-dirty
cargo fmt
Expand Down Expand Up @@ -146,14 +147,15 @@ run-cli: js

test: export JS_MINIFY = 0
test: js
cargo run -- test -d bundle/__tests__/tests/unit
cargo run -- test -d bundle/__tests__/unit
test-e2e: export JS_MINIFY = 0
test-e2e: js
cargo run -- test -d bundle/__tests__/tests/e2e
cargo run -- test -d bundle/__tests__/e2e

test-ci: export JS_MINIFY = 0
test-ci: clean-js | toolchain js
cargo $(TOOLCHAIN) -Z panic-abort-tests test --target $(CURRENT_TARGET)
# cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- test -d bundle/__tests__/tests/e2e # temporary skip e2e tests when running on Github
cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- test -d bundle/__tests__/unit

libs-arm64: lib/arm64/libzstd.a lib/zstd.h
libs-x64: lib/x64/libzstd.a lib/zstd.h
Expand Down
Loading

0 comments on commit d0d4cbf

Please sign in to comment.