Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smapiot/piral-cli-integration-tests
Integration tests for the piral-cli :vertical_traffic_light:.
https://github.com/smapiot/piral-cli-integration-tests
automation cli integration-tests microfrontends nodejs piral piral-cli piral-inspector
Last synced: 19 days ago
JSON representation
Integration tests for the piral-cli :vertical_traffic_light:.
- Host: GitHub
- URL: https://github.com/smapiot/piral-cli-integration-tests
- Owner: smapiot
- License: mit
- Created: 2020-12-04T13:28:56.000Z (about 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-10-23T17:04:46.000Z (2 months ago)
- Last Synced: 2024-11-23T19:35:36.384Z (about 1 month ago)
- Topics: automation, cli, integration-tests, microfrontends, nodejs, piral, piral-cli, piral-inspector
- Language: TypeScript
- Homepage: https://piral.io
- Size: 11.8 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)
# Piral CLI Acceptance Tests
Integration tests for the `piral-cli` tool and its default bundler. Can be used as a test bench when implementing a new bundler, too.
## Status
[![Overall](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main)
| OS | Node | Status |
| ------------ | ------ | ------------ |
| Linux | 18.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20linux_node_18)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |
| Linux | 22.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20linux_node_22)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |
| Windows | 18.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20windows_node_18)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |
| Windows | 22.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20windows_node_22)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |
| MacOS | 18.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20macos_node_18)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |
| MacOS | 22.x | [![Build Status](https://smapiot.visualstudio.com/piral-pipelines/_apis/build/status/smapiot.piral-cli-integration-tests?branchName=main&jobName=Job&configuration=Job%20macos_node_22)](https://smapiot.visualstudio.com/piral-pipelines/_build/latest?definitionId=46&branchName=main) |## Important Links
* π’ **[We are hiring!](https://smapiot.com/jobs)** - work with us on Piral, its ecosystem and our users
* π [Website](https://piral.io/) - learn more about Piral
* π [Documentation](https://docs.piral.io/) - everything to get started and master micro frontends
* π **Help translating Piral!** - making PRs in the [documentation branch](https://github.com/smapiot/piral/tree/documentation)
* π [Issue Tracker](https://github.com/smapiot/piral/issues) - report bugs or suggest new features
* π¨ [Forums](https://stackoverflow.com/questions/tagged/piral) - use the community support on StackOverflow
* πͺ [Community Chat](https://gitter.im/piral-io/community) - ask questions and provide answers in our Gitter room## Running the Tests
After you cloned the repository run:
```sh
npm i
```or an alternative command using your favorite package manager.
Now you can try running all tests:
```sh
npm start
```You can also run the tests from a specific file only:
```sh
npm start -- src/pilet-build.test.ts
```If you are only interested in a single test (e.g., `'can build a standard templated v2 pilet from sample-piral'`) then run it via:
```sh
npm start -- src/pilet-build.test.ts -t 'can build a standard templated v2 pilet from sample-piral'
```**Caution**: Tests that leverage the integrated browser (using the `page` variable) can only be run if the whole test suite (i.e., no `-t` is specified) is run.
For Ubuntu 18.04 and higher the system dependencies can get installed automatically. Many other systems may just work without any special dependencies:
```sh
npx playwright install-deps chromium
```To ensure everything is working with the test browser we recommend also installing the [browsers from Playwright](https://playwright.dev/docs/cli#install-browsers) via the command line:
```sh
npx playwright install chromium
```## Testing Package
[![npm version](https://img.shields.io/npm/v/@smapiot/piral-cli-integration-tests.svg?style=flat)](https://www.npmjs.com/package/@smapiot/piral-cli-integration-tests)
The tests are also available as a drop-in package to test bundler plugins. You can install it with:
```sh
npm i @smapiot/piral-cli-integration-tests
```Then run the tests using
```sh
npx piral-cli-tests
```If you don't specify the bundler name then the current working directory's *package.json* will be used to infer it.
## Tests
### Piral
- β Scaffold Piral instance
- β Run/debug Piral instance
- β Build Piral instance release
- β Build Piral instance emulator
- β Build Piral instance emulator sources
- β Generate Piral instance declaration
- β Validate Piral instance
- β Use Piral instance emulator for scaffolding locally
- β Change Piral instance while debugging (HMR)
- β Upgrade Piral instance from older (0.12.0 -> ENV) to recent version
- β Check Piral instance with debugging API (e.g., for `piral-inspector`)### Pilet
- β Scaffold pilet (using `sample-piral`)
- β Run/debug new pilet
- β Build `mf` pilet
- β Build `v3` pilet
- β Build `v2` pilet
- β Build `v1` pilet
- β Build `v0` pilet
- β Build standalone pilet
- β Build pilet manifest file
- β Publish pilet (to temp. feed)
- β Validate pilet
- β Change pilet while debugging (reinject pilet)
- βΈοΈ Upgrade pilet from older `sample-piral` to current
- β Check pilet with debugging API (e.g., for `piral-inspector`)The publish pilet command uses:
```sh
pilet publish --api-key {key} --url https://feed.piral.cloud/api/v1/pilet/temp --fresh
```It also can perform against a feed [hosted by the `sample-pilet-service`](https://github.com/smapiot/sample-pilet-service).
## Enviroment variables
| ENV | Description | Default |
| ------------------ | ---------------------------------- | ---------- |
| `CLI_VERSION` | Version of the `piral-cli` package | `latest` |
| `BUNDLER_PLUGIN` | The name of the bundler to use | |
| `BUNDLER_FEATURES` | The features of the bundler plugin | *all* |Available features:
- `codegen`, can handle `*.codegen` files
- `splitting`, can handle `import()` calls with a new JS side-bundle
- `pilet.v0`, supports the `v0` schema
- `pilet.v1`, supports the `v1` schema
- `pilet.v2`, supports the `v2` schema
- `pilet.v3`, supports the `v3` schema
- `pilet.mf`, supports the `mf` schema
- `importmap.ref`, supports usage of an importmap
- `importmap.local`, supports local creation of importmap side-bundles
- `build.pilet`, supports building a pilet
- `build.piral`, supports building a Piral instance
- `debug.pilet`, supports debugging a pilet
- `debug.piral`, supports debugging a Piral instance
- `hmr`, supports hot module reloading (for Piral instances)## License
Piral is released using the MIT license. For more information see the [license file](./LICENSE).