From 473de9d016c9d465236507d3e2f2f2acd19b3bf4 Mon Sep 17 00:00:00 2001 From: Kaushik <108662423+kaushikravichandran@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:36:37 -0400 Subject: [PATCH 1/2] feat: Jenkins support (#394) * random change * rename step * Remove old jenkins config * separate coveralls stage * remove \n * parallel test and coveralls * add dev env setup * change env name * env for parser * env name * fix syntax * single stage * revert to old jenkins * old env name * remove tests Co-authored-by: Kaushik Ravichandran Co-authored-by: Kaushik Ravichandran Co-authored-by: Kaushik Ravichandran --- .github/workflows/jenkins-job.yml | 17 ----------------- Jenkinsfile | 1 - 2 files changed, 18 deletions(-) delete mode 100644 .github/workflows/jenkins-job.yml diff --git a/.github/workflows/jenkins-job.yml b/.github/workflows/jenkins-job.yml deleted file mode 100644 index 2a7c4fe21..000000000 --- a/.github/workflows/jenkins-job.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Trigger Jenkins Job -on: - pull_request: - branches: - - master -jobs: - build: - name: Run Test Suite - runs-on: ubuntu-latest - steps: - - name: Trigger Jenkins Job - uses: appleboy/jenkins-action@master - with: - url: "https://ada-00.cc.gatech.edu/jenkins" - user: "gtdbuser" - token: ${{ secrets.JENKINS_ACCESS_TOKEN }} - job: "eva" diff --git a/Jenkinsfile b/Jenkinsfile index 65ebeb6ad..72e728763 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,6 @@ python setup.py install ''' stage('Test') { steps { sh '''. env37/bin/activate -sh script/test/test.sh coveralls''' } } From 366ecdba922fa58bfa7a41f0a38e1b747a396665 Mon Sep 17 00:00:00 2001 From: Aubhro Sengupta Date: Fri, 23 Sep 2022 14:48:43 -0400 Subject: [PATCH 2/2] Fix eva config update bug (#393) * Fix eva config update bug Updating the yaml file was appending to instead of rewriting file * Fix configuration test bug Mode field was being reset to the value of datasets_dir instead of the old value of mode. --- eva/configuration/bootstrap_environment.py | 2 ++ eva/configuration/configuration_manager.py | 2 ++ test/configuration/test_configuration_manager.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eva/configuration/bootstrap_environment.py b/eva/configuration/bootstrap_environment.py index c1684e58c..582b33567 100644 --- a/eva/configuration/bootstrap_environment.py +++ b/eva/configuration/bootstrap_environment.py @@ -89,7 +89,9 @@ def bootstrap_environment(eva_config_dir: Path, eva_installation_dir: Path): config_obj["core"]["catalog_database_uri"] = DB_DEFAULT_URI config_obj["storage"]["upload_dir"] = str(upload_dir.resolve()) + yml_file.seek(0) yml_file.write(yaml.dump(config_obj)) + yml_file.truncate() # set logger to appropriate level (debug or release) level = logging.WARN if mode == "release" else logging.DEBUG diff --git a/eva/configuration/configuration_manager.py b/eva/configuration/configuration_manager.py index 9e7a2c0d8..df7ef091b 100644 --- a/eva/configuration/configuration_manager.py +++ b/eva/configuration/configuration_manager.py @@ -60,7 +60,9 @@ def _update(cls, category: str, key: str, value: str): raise ValueError(f"Invalid yml file at {cls._yml_path}") config_obj[category][key] = value + yml_file.seek(0) yml_file.write(yaml.dump(config_obj)) + yml_file.truncate() @classmethod def get_value(cls, category: str, key: str) -> Any: diff --git a/test/configuration/test_configuration_manager.py b/test/configuration/test_configuration_manager.py index c1fb39136..f589dff25 100644 --- a/test/configuration/test_configuration_manager.py +++ b/test/configuration/test_configuration_manager.py @@ -37,7 +37,7 @@ def test_configuration_manager_read_invalid_key(self): _ = self.config.get_value("core", "invalid") def test_configuration_manager_update_valid_key(self): - value = self.config.get_value("core", "datasets_dir") + value = self.config.get_value("core", "mode") updated = "debug2" self.config.update_value("core", "mode", updated)