Skip to content

Provide devworkspace support, upgraded Quarkus version to 2.7.1.Final #82

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

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 0 additions & 29 deletions .github/workflows/nodejs-ci.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Set up node
uses: actions/setup-node@v1
with:
Expand Down
47 changes: 30 additions & 17 deletions backend-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,54 @@

This library is meant to be extended later by other libraries. It implements a very small telemetry API that does not do much, require extension to add more capability.

## Requirements
* JDK 11+
* Apache Maven 3.8.1+

## Building

Be sure to set `che.api` and `che.workspace.id` in `src/main/resources/application.properties` or set them on the command line during the maven run
Be sure to set `devworkspace.id` in `src/main/resources/application.properties` or set it on the command line during the maven run:

`mvn pckage [-Dche.api=http://... -Dche.workspace.id....]`
```shell script
mvn package -Ddevworkspace.id=foo
```

For a native Quarkus image:
For a native Quarkus image, run:

`mvn pckage -Pnative [-Dche.api=http://... -Dche.workspace.id....]`
```shell script
mvn package -Pnative -Dnative-image.docker-build=true -Ddevworkspace.id=foo
[docker|podman] build -f src/main/docker/Dockerfile.native -t quarkus/telemetry-backend-base .
```

## Testing

### Unit testing

`mvn test`
```shell script
mvn test
```

### Integration Testing
### Native-mode integration testing

#### Prerequesites
#### Prerequisites

+ A Running Che Cluster in CRC, Minikube, Kind, etc.
+ A workspace ID
+ The `CHE_MACHINE_TOKEN` from the workspace
+ A devworkspace ID of a devworkspace in the cluster

##### Standard Integration Test (Not native-mode)
In the `src/main/resources/application.properties` file, add:
```
%test.devworkspace.id=<devworkspace ID>
```

Then run:
```shell script
export CHE_MACHINE_TOKEN=<token from workspace>
mvn [integration-test | verify] -Dche.api<the URL of the che api> -Dche.workspace.id=<che workspace id>
kubectl config set-context --current --namespace=<namespace that the devworkspace is in>
mvn verify -Pnative -Dquarkus.test.native-image-profile=test
```

##### Native-mode testing

Compile the native binary with your che.api and che.workspace.id values either in application.properties or on the command line, as above

To run the native integration tests with the native image already built, run:
```shell script
mvn [integration-test | verify] -Dche.api=<URL of Che API> -Dche.workspace.id=<che workspace ID> -Dnative.image.path=target/backend-base-0.0.1-SNAPSHOT-runner
export DEVWORKSPACE_ID=<devworkspace ID>
mvn test-compile failsafe:integration-test
unset DEVWORKSPACE_ID
```
Loading