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

refactor: move tests to top-level out of the devcontainer folder #624

Merged
merged 15 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .devcontainer/cpp-test/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"image": "ghcr.io/philips-software/amp-devcontainer-cpp:${localEnv:IMAGE_VERSION}",
"workspaceFolder": "/workspaces/amp-devcontainer/.devcontainer/cpp/e2e/workspace",
"workspaceFolder": "/workspaces/amp-devcontainer/test/cpp/workspace",
"customizations": {
"vscode": {
"settings": {
Expand Down
4 changes: 4 additions & 0 deletions .devcontainer/rust-test/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "ghcr.io/philips-software/amp-devcontainer-rust:${localEnv:IMAGE_VERSION}",
"workspaceFolder": "/workspaces/amp-devcontainer/test/rust/workspace"
}
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
- run: cd .devcontainer/${{ inputs.flavor }}/e2e && npm test
- run: cd test/${{ inputs.flavor }}/e2e && npm test
env:
GITHUB_USER: ${{ secrets.TEST_GITHUB_USER }}
GITHUB_PASSWORD: ${{ secrets.TEST_GITHUB_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Run Tests
run: |
set -Eeuo pipefail
docker run --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src="${{ github.workspace }}/.devcontainer/${{ matrix.flavor }}/test",dst=/ws -w /ws ${{ github.repository }}-${{ matrix.flavor }}:test bats --formatter junit testsuite.bats | tee test-report-${{ matrix.flavor }}.xml
docker run --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src="${{ github.workspace }}/test/${{ matrix.flavor }}",dst=/ws -w /ws ${{ github.repository }}-${{ matrix.flavor }}:test bats --formatter junit integration-tests.bats | tee test-report-${{ matrix.flavor }}.xml
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
Expand Down
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"version": "2.0.0",
"tasks": [
{
"label": "Run Tests",
"label": "Run Integration Tests",
"type": "shell",
"group": {
"kind": "test",
"isDefault": true
},
"command": "bats",
"args": ["testsuite.bats"],
"args": ["integration-tests.bats"],
"options": {
"cwd": "${workspaceFolder}/.devcontainer/${env:CONTAINER_FLAVOR}/test"
"cwd": "${workspaceFolder}/test/${env:CONTAINER_FLAVOR}"
},
"presentation": {
"reveal": "always",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ Given("the default build configuration is selected", async () => {
Given("the file {string} is opened in the editor", async ({ codespacePage }, file: string) => {
const fileExtension = path.extname(file).slice(1);

switch (fileExtension) {
case 'cpp':
await codespacePage.openCppFileInEditor(file);
break;
default:
await codespacePage.openFileInEditor(file);
if (fileExtension === 'cpp') {
await codespacePage.openCppFileInEditor(file);
} else {
await codespacePage.openFileInEditor(file);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ teardown_file() {
setup() {
load '/usr/local/bats-support/load'
load '/usr/local/bats-assert/load'

pushd workspace
}

teardown() {
rm -rf build crash-* $(conan config home)/p

popd
}

@test "valid code input should result in working executable using host compiler" {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ bats_require_minimum_version 1.5.0
setup() {
load '/usr/local/bats-support/load'
load '/usr/local/bats-assert/load'

pushd workspace
}

teardown() {
rm -rf build ./**/target ./**/default*.prof* ./**/mutants.out

popd
}

@test "valid code input should result in working executable targeting the host architecture" {
Expand Down
Loading