Skip to content

Commit 3c4e4a3

Browse files
committed
Merge branch 'dev' into beta
2 parents 20da572 + 6ab358e commit 3c4e4a3

File tree

222 files changed

+12089
-4332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+12089
-4332
lines changed

.aiignore

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
# An .aiignore file follows the same syntax as a .gitignore file.
22
# .gitignore documentation: https://git-scm.com/docs/gitignore
33

4-
# ....Plan staging and drafts......................................................................
5-
# This directory is a staging area for proposed plan
6-
/.junie/junie_proposed_solution_staging/*
7-
/.junie/plan_draft/*
4+
# ....Junie related................................................................................
5+
/.junie/iceboxed_plans/
6+
/.junie/scratch.md
7+
/.junie/recipes.md
88

9-
# ....Dockerized-NorLab-Project rlated.............................................................
10-
/.dockerized_norlab_project/dn_container_env_variable/
11-
12-
# ....Project data directories.....................................................................
13-
/external_data/*
14-
/artifact/*
15-
/tests/artifact/*
9+
# ....Dockerized-NorLab Project related............................................................
10+
/external_data/
11+
/artifact/
12+
/tests/artifact/
1613

1714
# ....General file type............................................................................
1815
venv/
1916
__pycache__/
2017
*.benchmarks/
2118
*.pytest_cache/
2219
.idea/
20+
.DS_Store
2321

2422
**/video/*.meta.json
2523
*.mp4

.dockerignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# ====Dockerized-NorLab============================================================================
1717
# ....Dev required.................................................................................
18-
!**/.dockerized_norlab_project/
18+
!**/.dockerized_norlab/
1919
!**/version.txt
2020
!**/.git
2121

@@ -24,7 +24,7 @@
2424
!**/artifact/
2525
!/utilities/tmp/dockerized-norlab-project-mock/
2626

27-
# ....DNP common...................................................................................
27+
# ....DNA common...................................................................................
2828
**/slurm_jobs_logs/*.log
2929

3030
# ====General======================================================================================

.env.dockerized-norlab-project

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,21 @@
1313
#
1414
# =================================================================================================
1515

16-
PROJECT_PROMPT_NAME="DNP"
17-
NBS_SPLASH_NAME="DNP-build-system"
16+
#PROJECT_PROMPT_NAME="DNA"
17+
#PROJECT_PROMPT_NAME="DN"
18+
PROJECT_PROMPT_NAME="dna"
19+
20+
#DNA_SPLASH_NAME_FULL="Dockerized-NorLab"
21+
DNA_SPLASH_NAME_FULL="Dockerized-NorLab (DN)"
22+
#DNA_SPLASH_NAME_FULL="Dockerized-NorLab project app (DNA)"
23+
#DNA_SPLASH_NAME_FULL="Dockerized-NorLab project application"
24+
DNA_SPLASH_NAME_SMALL="Dockerized-NorLab"
25+
#DNA_SPLASH_NAME_SMALL="DNA"
26+
#DNA_SPLASH_NAME_SMALL="·• DNA"
27+
#DNA_SPLASH_NAME_SMALL="···•· DNA ··••"
28+
#DNA_SPLASH_NAME_SMALL=" Dockerized-NorLab "
29+
#DNA_SPLASH_NAME_SMALL="❄︎ Dockerized-NorLab"
30+
NBS_SPLASH_NAME="${PROJECT_PROMPT_NAME}-build-system"
1831

1932
# ....Programaticaly fetch source code information.................................................
2033
# (NICE TO HAVE) ToDo: assessment >> next bloc ↓↓
@@ -27,10 +40,10 @@ PROJECT_PATH="$( git rev-parse --show-toplevel )"
2740
# Note: Those with "PROJECT_" prefix will get eventualy overiden in the case where N2ST is used
2841
# as a library. Using generic testing logic require that environment variables with
2942
# "PROJECT_" prefix be available.
30-
DNP_PROMPT_NAME="${PROJECT_PROMPT_NAME}"
31-
DNP_GIT_REMOTE_URL="https://github.com/norlab-ulaval/dockerized-norlab-project"
32-
DNP_GIT_NAME="dockerized-norlab-project"
33-
#DNP_SRC_NAME="dockerized-norlab-project"
43+
DNA_PROMPT_NAME="${PROJECT_PROMPT_NAME}"
44+
DNA_GIT_REMOTE_URL="https://github.com/norlab-ulaval/dockerized-norlab-project"
45+
DNA_GIT_NAME="dockerized-norlab-project"
46+
#DNA_SRC_NAME="dockerized-norlab-project"
3447

3548
# ....Set dependencies path........................................................................
3649
N2ST_PATH="${PROJECT_PATH}/utilities/norlab-shell-script-tools"
@@ -39,19 +52,19 @@ NBS_PATH="${PROJECT_PATH}/utilities/norlab-build-system"
3952
NBS_VERSION="$(cat ${NBS_PATH}/version.txt)"
4053
N2ST_VERSION="$(cat ${N2ST_PATH}/version.txt)"
4154

42-
# ====DNP==========================================================================================
43-
DNP_VERSION="$(cat ${PROJECT_PATH}/version.txt)"
44-
DNP_CONFIG_SCHEME_VERSION=1
55+
# ====DNA==========================================================================================
56+
DNA_VERSION="$(cat ${PROJECT_PATH}/version.txt)"
57+
DNA_CONFIG_SCHEME_VERSION=1
4558

4659
# ....internal.....................................................................................
47-
DNP_ROOT="${PROJECT_PATH}"
60+
DNA_ROOT="${PROJECT_PATH}"
4861

49-
DNP_PATH="${DNP_ROOT}/src/bin"
50-
DNP_LIB_PATH="${DNP_ROOT}/src/lib"
51-
DNP_LIB_EXEC_PATH="${DNP_LIB_PATH}/core/execute"
52-
DNP_MOCK_SUPER_PROJECT_ROOT="${DNP_ROOT}/utilities/tmp/dockerized-norlab-project-mock"
62+
DNA_PATH="${DNA_ROOT}/src/bin"
63+
DNA_LIB_PATH="${DNA_ROOT}/src/lib"
64+
DNA_LIB_EXEC_PATH="${DNA_LIB_PATH}/core/execute"
65+
DNA_MOCK_SUPER_PROJECT_ROOT="${DNA_ROOT}/utilities/tmp/dockerized-norlab-project-mock"
5366

5467
# ....dev..........................................................................................
55-
DNP_DEBUG=false
56-
DNP_CLEAR_CONSOLE_ACTIVATED=false
68+
DNA_DEBUG=false
69+
DNA_CLEAR_CONSOLE_ACTIVATED=false
5770

.gitignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66
!**/artifact/README.md
77
!**/artifact/optuna_storage/README.md
88

9-
# ....DNP common...................................................................................
10-
**/.dockerized_norlab_project/dn_container_env_variable/
9+
# ....DNA common...................................................................................
10+
**/.dockerized_norlab/dn_container_env_variable/
1111
**/external_data/
1212
**/artifact/
1313
**/slurm_jobs_logs/*.log
1414

1515
# ====General======================================================================================
16+
17+
# ....Jetbrains....................................................................................
18+
/.idea/
19+
/.vagrant/*
20+
21+
# ....AI...........................................................................................
22+
/.junie/scratch.md
23+
/.junie/iceboxed_plans
24+
1625
# ....Python related...............................................................................
1726
**/.pytest_cache
1827
**/.benchmarks
@@ -21,10 +30,7 @@
2130

2231
# ....Log..........................................................................................
2332
**/*.out
24-
25-
# ....Jetbrains....................................................................................
26-
/.idea/
27-
/.vagrant/*
33+
**/*.log
2834

2935
# ....General......................................................................................
3036
**/.DS_Store
Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,87 @@
11

2-
# Dockerized-NorLab-Project guideline
3-
4-
Stand-alone version with a PATH-accessible bash script approach
5-
2+
# Repository Guidelines
3+
64
## General Requirements:
75
- Don't repeat yourself. Use already implemented code such as:
86
- `load_repo_main_dotenv.bash`
9-
- `import_dnp_lib.bash`
7+
- `import_dna_lib.bash`
108
- `load_super_project_config.bash`
11-
- N2ST library
12-
- NBS library
9+
- _N2ST_ library
10+
- _NBS_ library
1311
- Path management:
1412
- Case 1 › system wide:
15-
- via symlink `/usr/local/bin/dnp``/path/to/dockerized-norlab-project/src/bin/dnp`;
16-
- via `~/.bashrc``PATH=${PATH}:${DNP_PATH}:${NBS_PATH}:${N2ST_PATH}`.
13+
- via symlink `/usr/local/bin/dna``/path/to/dockerized-norlab-project/src/bin/dna`;
14+
- via `~/.bashrc``PATH=${PATH}:${DNA_PATH}:${NBS_PATH}:${N2ST_PATH}`.
1715
- Case 2 › manual load:
18-
- each super project can optionally use the env var `DNP_PATH`, `NBS_PATH` and `N2ST_PATH` define in `.env.dockerized-norlab-project`.
16+
- each super project can optionally use the env var `DNA_PATH`, `NBS_PATH` and `N2ST_PATH` define in `.env.dockerized-norlab-project`.
1917

20-
## Repository Development Organization
21-
- `src/bin/dnp` is the DNP application entrypoint
22-
- `src/lib/` contain lybrary files
18+
## Repository Organization
19+
- `src/bin/dna` is the DNA application entrypoint
20+
- `src/lib/` contain library files
2321
- `tests/` contain tests files
2422
- `tests/tests_bats/` contain N2ST bats framework files that are mainly used for unit-testing
25-
- `tests/tests_dryrun_and_tests_scripts/` contain integration test (see details bellow)
26-
- `utilities` contain external libraries such as N2ST and NBS
23+
- `tests/tests_dryrun_and_tests_scripts/` contain integration test (see details below)
24+
- `utilities/` contain external libraries such as N2ST and NBS
2725
- `utilities/tmp/dockerized-norlab-project-mock` is use for cloning a fresh copy of a mock "super project" from https://github.com/norlab-ulaval/dockerized-norlab-project-mock.git on test execution.
28-
`dockerized-norlab-project-mock` is a mock of how a user would install and uses DNP. We refer to this as a "super project" or the "user side".
26+
`dockerized-norlab-project-mock` is a mock of how a user would install and uses DNA. We refer to this as a "super project" or the "user side".
27+
28+
## Version Control
29+
- Never `git add` or `git commit` changes, all changes require explicit code review and acceptance by the codeowner.
2930

30-
## Tests Requirements:
31+
## Tests Requirements
32+
- In the context of testing:
33+
- the definition of _pass_ is that a test exit whitout error. Synomym: _green_, _successfull_;
34+
- the definition fo _done_ mean that all tests where executed and all tests passed.
3135

3236
### Testing Strategy
3337
- Inspect the tested script/functions for business logic related error or implementation error. Propose correction before going forward if any.
3438
- Write tests who chalenge the intended functionality or behavior.
3539
- Write **Unit-tests** and/or **Integration tests**:
3640
- All new scripts or functionalities need to have (either or both):
3741
- **Unit-tests**:
38-
- use [N2ST](https://github.com/norlab-ulaval/norlab-shell-script-tools) bats tests tools for unit-test (See `tests/run_bats_core_test_in_n2st.bash` script) and a corresponding bats unit-test `.bats` file in the `tests/tests_bats/` directory. Bats tests will be running in a docker container in complete isolation with a copy of the source code.
42+
- Those are tests that check if the core expected behaviors are satisfy. It test a piece of code in a stand alone fashion.
43+
- Use [N2ST](https://github.com/norlab-ulaval/norlab-shell-script-tools) bats tests tools for unit-test (See `tests/run_bats_core_test_in_n2st.bash` script) and a corresponding bats unit-test `.bats` file in the `tests/tests_bats/` directory. N2ST Bats tests are running in a docker container in complete isolation with a copy of the source code.
3944
- **Integration tests**:
40-
- those are test case where there is multiple script interacting whith each other or we want to assess execution from begining to end;
41-
- those tests are devided in two categories:
45+
- Those are test case where there is multiple script interacting whith each other or we want to assess execution from begining to end;
46+
- Those tests are devided in two categories:
4247
- Dryrun: either make use of a `--dry-run` flag implemented in the script or make use of the docker `--dry-run` flag;
4348
- Test: all other integration test case that are not dryrun.
44-
- Use [NBS](https://github.com/norlab-ulaval/norlab-build-system) tests tools for integration-test (See `tests/run_all_dryrun_and_tests_script.bash` script) and a corresponding `test_*` or `dryrun_*` script in the `tests/tests_dryrun_and_tests_scripts/` directory.
45-
- One test file (`.bats` or `.bash`) per coresponding source code script.
49+
- Use [NBS](https://github.com/norlab-ulaval/norlab-build-system) tests tools for integration-test (See `tests/run_all_dryrun_and_tests_script.bash` script) and a corresponding `test_*` or `dryrun_*` script in the `tests/tests_dryrun_and_tests_scripts/` directory.
50+
- New integration test script must go in the `tests/tests_dryrun_and_tests_scripts/` directory.
51+
- Their should be at least one test file (`.bats` and/or `.bash`) per coresponding source code script.
4652
- Identify relevant test cases e.g., behavior validation, error handling, desired user feedback, ...
47-
- If the tested script implement helper functions (i.e., support function meant to be used by the main function), test those functions first.
4853
- Divide test file by test cases: one test function per test case.
54+
- If the tested script implement helper functions (i.e., support function meant to be used by the main function), test those functions first.
4955
- Provide a summary explanation of the test case:
5056
- What does it test for;
5157
- What's the test expected outcome (i.e, should it pass or fail);
5258
- If you do mock something, justify why.
5359
- All tests in the `tests/` directory must pass.
54-
- The definition fo _Done_ mean that tests where executed and all tests passed.
60+
- Always execute all unit-tests and all integration tests before submiting.
61+
5562

5663
### Instruction On Mocking
5764
- You can mock shell core command an docker command.
5865
- You can mock `docker [OPTIONS|COMMAND]` commands and `git [OPTIONS|COMMAND]` commands.
5966
- Don't mock the functions that are tested in the tested script.
60-
- Avoid mocking n2st functions, at the expection of those in `src/function_library/prompt_utilities.bash`. For eaxample, instead of re-implementaing `n2st::seek_and_modify_string_in_file`, just load the real one and test that the content of the file at `file_path` has been updated? You can find the real one in `src/function_library/general_utilities.bash`.
67+
- Avoid mocking N2ST functions, at the exception of those in `${N2ST_PATH}/src/function_library/prompt_utilities.bash`. For example, instead of re-implementing `n2st::seek_and_modify_string_in_file`, just load the real one and test that the content of the file at `file_path` has been updated? You can find the real one in `${N2ST_PATH}/src/function_library/general_utilities.bash`.
6168
- Avoid mocking the `read` command. Instead use `echo 'y'` or `echo 'N'` for piping a keyboard input to the function who use the `read` command which in turn expect a single character, example: `run bash -c "echo 'y' | <the-tested-function>"`. Alternatively, use the `yes [n]` shell command which optionaly send [y|Y|yes] n time, example: `run bash -c "yes 2 | <the-tested-function>"`.
6269

6370
### Instruction On Bats Tests
6471
- Use bats framework `bats-file` helper library provide tools for temporary directory management, such as the `temp_make` and `temp_del` functions.
6572
Reference https://github.com/bats-core/bats-file?tab=readme-ov-file#working-with-temporary-directories
6673
- Use bats test function `assert_file_executable` and `assert_file_not_executable` to test executable.
6774
- Use bats test function `assert_symlink_to` and `assert_not_symlink_to` to test symlink.
68-
- You can test symlink `/usr/local/bin/dnp` directly without mocking since bats tests are running in a docker container in complete isolation.
75+
- You can test directory/file mode, existence, permision, content and symlink directly without mocking since bats tests are running in a docker container in complete isolation.
76+
- Test `/usr/local/bin/dna` symlink related logic directly without mocking.
6977

7078
Bats helper library documentation:
7179
- https://github.com/bats-core/bats-assert
7280
- https://github.com/bats-core/bats-file
7381
- https://github.com/bats-core/bats-support
7482

75-
### Bats Tests Execution
83+
### Instruction On Tests Execution
7684
- Don't directly execute `.bats` files, instead execute from the repository root `bash ./tests/run_bats_core_test_in_n2st.bash tests/tests_bats/<bats-file-name>.bats`.
7785
- Don't set tests script in executable mode instead execute them with `bash <the-script-name>.bash`.
86+
- Always run unit-tests before integration tests.
87+
- Never run integration tests if any unit-tests fail.

0 commit comments

Comments
 (0)