Skip to content

Commit

Permalink
Use devbox to manage development environment
Browse files Browse the repository at this point in the history
  • Loading branch information
rabelenda committed Sep 14, 2023
1 parent 2710bef commit 6343ebc
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc)"

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ When a test plan runs, the engine returns an instance of [TestPlanStats](Abstrac

Here we will detail the main steps and things to take into consideration when implementing a new test element, or extending an existing one.

Before doing any coding, consider that the project uses Java 8, maven 3.5, .Net SDK 6+, nodejs 18+, pnpm 8+ and docker as main dependencies, so make sure that you install them beforehand. You might also install [devbox](https://www.jetpack.io/devbox/docs/) and [direnv](https://direnv.net/) and then use existing devbox configuration to setup the development environment.

1. Check if you want something that is already supported by Java DSL and JMeter itself.
* This is very important and implementing support in the .Net library for something that is already supported in Java DSL is super simple. But, implementing something that has not yet support in the JMeter Java DSL, would require you to first contribute it to Java DSL, and then to the .Net library. Implementing something that is not even supported by JMeter, would require probably even more work, but don't despair, and always ask for help or support!
* If you need something that is already supported by Java DSL, follow previously mentioned conventions and continue reading :).
* If you need something that is not supported by Java DSL, then follow [Java DSL guidelines](https://github.com/abstracta/jmeter-java-dsl/blob/master/CONTRIBUTING.md#implementing-a-new-dsl-test-element-or-feature) and, after contributing the changes to Java DSL, follow previously mentioned conventions and continue reading!.
2. Implement tests that verify the expected behavior of the test element in a test plan execution. This way, you verify that you properly initialize JMeter properties and that your interpretation of the test element properties and behavior is right.
* Check [DslHttpSamplerTest](Abstracta.JmeterDsl.Tests/Http/DslHttpSamplerTest.cs) for some sample test cases.
3. Run `dotnet build` and `dotnet test` and fix any potential code styling issues or failing tests.
4. Add a new section [user guide](docs/guide), by adding a new md file and proper `<!-- @include: -->` in parent section, describing the new feature. Consider running in the `docs` directory `pnpm install` and `pnpm dev` (this requires node 18+ and pnpm installed on your machine) to run a local server for docs, where you can review that new changes are properly showing.
4. Add a new section [user guide](docs/guide), by adding a new md file and proper `<!-- @include: -->` in parent section, describing the new feature. Consider running in the `docs` directory `pnpm install` and `pnpm dev` (this requires node 18+ and pnpm installed on your machine) to run a local server for docs, where you can review that new changes are properly showing. If you use devbox then you can use `devbox run setup` and `devbox run docs`.
5. Commit changes to git, using as a comment a subject line that describes general changes, and if necessary, some additional details describing the reason why the change is necessary.
6. Submit a pull request to the repository including a meaningful name.
7. Check GitHub Actions execution to verify that no test fails on the CI pipeline.
Expand Down
31 changes: 31 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"packages": [
"maven@latest",
"nodejs@latest",
"nodePackages.pnpm@latest",
"temurin-bin-8@latest",
"dotnet-sdk@latest"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"setup": [
"pnpm --dir docs install"
],
"docs": [
"pnpm --dir docs dev"
],
"clean": [
"dotnet clean"
],
"build": [
"dotnet build"
],
"test": [
"dotnet test"
]
}
}
}
35 changes: 35 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"lockfile_version": "1",
"packages": {
"dotnet-sdk@latest": {
"last_modified": "2023-09-10T10:53:27Z",
"resolved": "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293#dotnet-sdk",
"source": "devbox-search",
"version": "6.0.413"
},
"maven@latest": {
"last_modified": "2023-09-10T10:53:27Z",
"resolved": "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293#maven",
"source": "devbox-search",
"version": "3.9.4"
},
"nodePackages.pnpm@latest": {
"last_modified": "2023-09-10T10:53:27Z",
"resolved": "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293#nodePackages.pnpm",
"source": "devbox-search",
"version": "8.6.12"
},
"nodejs@latest": {
"last_modified": "2023-09-10T10:53:27Z",
"resolved": "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293#nodejs_20",
"source": "devbox-search",
"version": "20.6.1"
},
"temurin-bin-8@latest": {
"last_modified": "2023-09-10T10:53:27Z",
"resolved": "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293#temurin-bin-8",
"source": "devbox-search",
"version": "8.0.372"
}
}
}

0 comments on commit 6343ebc

Please sign in to comment.