Skip to content

Commit 17a9848

Browse files
authored
Merge pull request #876 from juanjemdIos/master
more efficiense local test. Runtime platform. Fixes #867
2 parents ff93bd7 + 74ffd03 commit 17a9848

File tree

4 files changed

+143
-54
lines changed

4 files changed

+143
-54
lines changed

src/somef/parser/toml_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,9 @@ def parse_pyproject_metadata(data, metadata_result, source, file_path):
524524
metadata_result.add_result(
525525
constants.CAT_RUNTIME_PLATFORM,
526526
{
527-
"value": runtime["version"],
527+
"value": f'{runtime["name"]}{runtime["version"]}',
528528
"name": runtime["name"],
529+
"version": runtime["version"],
529530
"type": constants.STRING
530531
},
531532
1,

src/somef/somef_cli.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ def cli_get_data(threshold, ignore_classifiers, repo_url=None, doc_src=None, loc
8181
repo_type,
8282
authorization
8383
)
84-
print("\n=== DEBUG GITLAB SELF-HOSTED ===")
85-
print(f"repo_url: {repo_url}")
86-
print(f"owner: {owner}")
87-
print(f"repo_name: {repo_name}")
88-
print(f"def_branch: {def_branch}")
89-
print(f"repo_type: {repo_type}")
90-
print("=================================\n")
9184

9285
# download files and obtain path to download folder
9386
if readme_only:

src/somef/test/test_cli.py

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,19 @@ def test_issue_314(self):
447447
def test_issue_314_1(self):
448448
"""Checks that the program can be run using only a single readme. GitHub"""
449449
somef_cli.run_cli(threshold=0.8,
450-
ignore_classifiers=False,
451-
repo_url="https://github.com/tensorflow/tensorflow/tree/v2.6.0",
452-
doc_src=None,
453-
in_file=None,
454-
output=test_data_path + "test-314-1.json",
455-
graph_out=None,
456-
graph_format="turtle",
457-
codemeta_out=None,
458-
pretty=True,
459-
missing=True,
460-
readme_only=True)
450+
ignore_classifiers=False,
451+
# repo_url="https://github.com/tensorflow/tensorflow/tree/v2.6.0",
452+
repo_url=None,
453+
# doc_src=None,
454+
doc_src= test_data_path + "README-tensorflow-2.6.0.md",
455+
in_file=None,
456+
output=test_data_path + "test-314-1.json",
457+
graph_out=None,
458+
graph_format="turtle",
459+
codemeta_out=None,
460+
pretty=True,
461+
missing=True,
462+
readme_only=True)
461463
text_file = open(test_data_path + "test-314-1.json", "r")
462464
data = text_file.read()
463465
text_file.close()
@@ -469,17 +471,19 @@ def test_issue_314_1(self):
469471
def test_issue_314_2(self):
470472
"""Checks that the program can be run using only a single readme. Gitlab"""
471473
somef_cli.run_cli(threshold=0.8,
472-
ignore_classifiers=False,
473-
repo_url="https://gitlab.com/jleblay/tokei",
474-
doc_src=None,
475-
in_file=None,
476-
output=test_data_path + "test-314-2.json",
477-
graph_out=None,
478-
graph_format="turtle",
479-
codemeta_out=None,
480-
pretty=True,
481-
missing=False,
482-
readme_only=True)
474+
ignore_classifiers=False,
475+
# repo_url="https://gitlab.com/jleblay/tokei",
476+
repo_url=None,
477+
# doc_src=None,
478+
doc_src= test_data_path + "README-tokei.md",
479+
in_file=None,
480+
output=test_data_path + "test-314-2.json",
481+
graph_out=None,
482+
graph_format="turtle",
483+
codemeta_out=None,
484+
pretty=True,
485+
missing=False,
486+
readme_only=True)
483487
text_file = open(test_data_path + "test-314-2.json", "r")
484488
data = text_file.read()
485489
text_file.close()
@@ -491,17 +495,19 @@ def test_issue_314_2(self):
491495
def test_issue_314_3(self):
492496
"""Checks that the program can be run using only a single readme. Gitlab"""
493497
somef_cli.run_cli(threshold=0.8,
494-
ignore_classifiers=False,
495-
repo_url="https://gitlab.com/unboundedsystems/adapt/-/tree/release-0.1",
496-
doc_src=None,
497-
in_file=None,
498-
output=test_data_path + "test-314-3.json",
499-
graph_out=None,
500-
graph_format="turtle",
501-
codemeta_out=None,
502-
pretty=True,
503-
missing=True,
504-
readme_only=True)
498+
ignore_classifiers=False,
499+
# repo_url="https://gitlab.com/unboundedsystems/adapt/-/tree/release-0.1",
500+
repo_url=None,
501+
# doc_src=None,
502+
doc_src= test_data_path + "README-unboundedsystems.md",
503+
in_file=None,
504+
output=test_data_path + "test-314-3.json",
505+
graph_out=None,
506+
graph_format="turtle",
507+
codemeta_out=None,
508+
pretty=True,
509+
missing=True,
510+
readme_only=True)
505511
text_file = open(test_data_path + "test-314-3.json", "r")
506512
data = text_file.read()
507513
text_file.close()
@@ -530,6 +536,8 @@ def test_issue_403(self):
530536
somef_cli.run_cli(threshold=0.8,
531537
ignore_classifiers=False,
532538
repo_url="https://github.com/oeg-upm/wot-hive",
539+
# repo_url=None,
540+
# local_repo=test_data_repositories + "wot-hive",
533541
doc_src=None,
534542
in_file=None,
535543
output=test_data_path + "test-403.json",
@@ -589,7 +597,6 @@ def test_issue_225_406(self):
589597
text_file = open(test_data_path + "test-225.json", "r")
590598
data = text_file.read()
591599
text_file.close()
592-
print(data)
593600
assert data.find("\"" + constants.PROP_FORMAT + "\": \"" + constants.FORMAT_WIKI + "\"")
594601
os.remove(test_data_path + "test-225.json")
595602

@@ -617,18 +624,20 @@ def test_issue_406(self):
617624
def test_issue_255(self):
618625
"""Tests if somef can detect wiki articles"""
619626
somef_cli.run_cli(threshold=0.8,
620-
ignore_classifiers=False,
621-
repo_url="https://github.com/mbloch/mapshaper/",
622-
local_repo=None,
623-
doc_src=None,
624-
in_file=None,
625-
output=test_data_path + "test-255.json",
626-
graph_out=None,
627-
graph_format="turtle",
628-
codemeta_out=None,
629-
pretty=True,
630-
missing=True,
631-
readme_only=False)
627+
ignore_classifiers=False,
628+
# repo_url="https://github.com/mbloch/mapshaper/",
629+
repo_url=None,
630+
local_repo=None,
631+
# doc_src=None,
632+
doc_src=test_data_path + "README-mapshaper.md",
633+
in_file=None,
634+
output=test_data_path + "test-255.json",
635+
graph_out=None,
636+
graph_format="turtle",
637+
codemeta_out=None,
638+
pretty=True,
639+
missing=True,
640+
readme_only=False)
632641
text_file = open(test_data_path + "test-255.json", "r")
633642
data = text_file.read()
634643
text_file.close()
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[![Adapt logo](https://adaptjs.org/img/logo_lockup.svg)](https://adaptjs.org)
2+
3+
[![npm](https://img.shields.io/npm/v/@adpt/cli?color=blue)](https://www.npmjs.com/package/@adpt/cli)
4+
[![Gitter](https://badges.gitter.im/UnboundedSystems/Adapt.svg)](https://gitter.im/UnboundedSystems/Adapt)
5+
[![License](https://img.shields.io/github/license/unboundedsystems/adapt)](https://opensource.org/licenses/Apache-2.0)
6+
7+
# Adapt - ReactJS for your infrastructure.
8+
9+
AdaptJS is a system to easily, reliably, and repeatably deploy your full-stack applications. Adapt specifications look like [React](https://reactjs.org) apps, but instead of rendering browser DOM elements like `<input>`, or `<div>`, Adapt specifications use elements like AWS `<EC2Instance>`, Kubernetes `<Pod>`, or `<MongoDB>` database.
10+
11+
If you're already familiar with React, you'll feel right at home with Adapt.
12+
But if not, don't worry, knowledge of React isn't required to start using Adapt.
13+
14+
## Getting Started
15+
16+
For a new project, it's easy to get started with Adapt by using a starter template.
17+
The [Getting Started Guide](https://adaptjs.org/docs/getting_started) will walk through installing Adapt and deploying your first starter app.
18+
19+
## Creating and deploying an app
20+
21+
This example creates a new full-stack app from a starter template.
22+
It has a [React](https://reactjs.org) UI, an [Nginx](https://nginx.org) web server, a [Node.js](https://nodejs.org) API server, and a [Postgres](https://postgresql.org) database, then deploys it to [Kubernetes](https://kubernetes.io/):
23+
24+
```bash
25+
# Install adapt
26+
npm install -g @adpt/cli
27+
28+
# Create a new app from a starter template
29+
adapt new hello-react-node-postgres ./myapp
30+
cd myapp/deploy
31+
32+
# Deploy full stack locally using Docker
33+
adapt run laptop
34+
35+
# Or just as easily deploy everything to Kubernetes
36+
adapt run k8s-test
37+
```
38+
39+
An Adapt description for a complete front end and back end app stack looks like this:
40+
41+
```jsx
42+
import Adapt from "@adpt/core";
43+
import { NodeService, ReactApp } from "@adpt/cloud/nodejs";
44+
import { Postgres } from "@adpt/cloud/postgres";
45+
46+
function MyApp() {
47+
const pg = Adapt.handle();
48+
49+
return (
50+
<Adapt.Group>
51+
<ReactApp srcDir="../frontend" />
52+
<NodeService srcDir="../backend" connectTo={pg} />
53+
<Postgres handle={pg} />
54+
</Adapt.Group>
55+
);
56+
}
57+
```
58+
59+
## Adapt in action
60+
61+
This demo shows using Adapt to create and deploy a simple app called MovieDB that has a [React](https://reactjs.org) UI, an [Nginx](https://nginx.org) web server, an Nginx URL router, a [Node.js](https://nodejs.org) API server, and a [Postgres](https://postgresql.org) database, then deploys it to [Kubernetes](https://kubernetes.io/):
62+
63+
![Adapt in action](https://adaptjs.org/docs/assets/getting_started/adapt-demo-scaled.gif)
64+
65+
## More info
66+
67+
* [Adaptjs.org](https://adaptjs.org)
68+
69+
Learn more about Adapt.
70+
71+
* [Getting Started Guide](https://adaptjs.org/docs/getting_started)
72+
73+
This guide will walk you through setting up Adapt and then deploying an example MovieDB app.
74+
75+
* [Adapt Documentation](https://adaptjs.org/docs)
76+
77+
Adapt tutorials, API References, and more.
78+
79+
## Getting Help
80+
81+
[![Gitter](https://badges.gitter.im/UnboundedSystems/Adapt.svg)](https://gitter.im/UnboundedSystems/Adapt)
82+
83+
We'd love to hear about your experience with Adapt!
84+
Join us on our [Gitter channel](https://gitter.im/UnboundedSystems/Adapt) to ask questions or to give us your feedback and suggestions.
85+
86+
If you've found a bug, you can also [file an issue](https://gitlab.com/unboundedsystems/adapt/issues).

0 commit comments

Comments
 (0)